{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第一周讲义"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Bokeh绘图基本准备"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 本周学习主要内容 Bokeh制图 其流程可分为以下步骤"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "|序号|步骤|\n",
    "|---|-----|\n",
    "|1|展示方式，选取适当的展示数据的视图|\n",
    "|2|查看文件，找到相应的文档、接口|\n",
    "|3|准备需要展示的数据|\n",
    "|4|根据文档准备将画布的基本属性进行配备|\n",
    "|5|完整代码|\n",
    "|6|绘图（show）|"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Bokeh 文档网址链接 [点击跳转](https://docs.bokeh.org/en/latest/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 详细步骤\n",
    "准备数据\n",
    "\n",
    "示例中是Python列表，也可以是NumPy数组或Pandas系列。\n",
    "\n",
    "输出html文件\n",
    "\n",
    "示例中使用output_file()，文件名为“lines.html”。在Jupyter notebooks中也可以使用output_notebook()。\n",
    "\n",
    "调用figure()\n",
    "\n",
    "这一步将创建一个具有典型默认选项的图形，并可轻松定制标题，工具和坐标轴标签。\n",
    "\n",
    "添加渲染器\n",
    "\n",
    "在示例中，我们使用line()制作折线图，渲染器可以自定义视觉，包括颜色，图例，宽度等。\n",
    "\n",
    "显示(show())或保存(save())结果\n",
    "\n",
    "这些功能将HTML绘图保存到文件中、显示在浏览器中。\n",
    "\n",
    "如果我们需要通过添加更多的数据系列，符号，对数坐标轴等等来更多地定制输出，那么bokeh.plotting接口也非常方便。 如下代码，可以轻松制作组合图表：\n",
    "\n",
    "from bokeh.plotting import figure, output_file, show\n",
    "\n",
    "### 准备数据\n",
    "\n",
    "x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]\n",
    "\n",
    "y0 = [i**2 for i in x]\n",
    "\n",
    "y1 = [10**i for i in x]\n",
    "\n",
    "y2 = [10**(i**2) for i in x]\n",
    "\n",
    "### 输出html文件\n",
    "\n",
    "output_file(\"log_lines.html\")\n",
    "\n",
    "### 创建图表\n",
    "\n",
    "p = figure(\n",
    "\n",
    "tools=\"pan,box_zoom,reset,save\",\n",
    "\n",
    "y_axis_type=\"log\", y_range=[0.001, 10**11], title=\"log axis example\",\n",
    "\n",
    "x_axis_label='sections', y_axis_label='particles'\n",
    "\n",
    ")\n",
    "\n",
    "### 添加渲染器\n",
    "\n",
    "p.line(x, x, legend=\"y=x\")\n",
    "\n",
    "p.circle(x, x, legend=\"y=x\", fill_color=\"white\", size=8)\n",
    "\n",
    "p.line(x, y0, legend=\"y=x^2\", line_width=3)\n",
    "\n",
    "p.line(x, y1, legend=\"y=10^x\", line_color=\"red\")\n",
    "\n",
    "p.circle(x, y1, legend=\"y=10^x\", fill_color=\"red\", line_color=\"red\", size=6)\n",
    "\n",
    "p.line(x, y2, legend=\"y=10^x^2\", line_color=\"orange\", line_dash=\"4 4\")\n",
    "\n",
    "### 展示结果\n",
    "\n",
    "show(p)\n",
    "\n",
    "\n",
    "Jupyter Notebooks默认工作目录的修改\n",
    "\n",
    "安装Anaconda后，开始菜单-Anaconda文件夹-Jupyter Notebooks，打开Jupyter Notebooks后，首页显示就是默认的工作目录，但很大概率上并不是我们想要的，所以，介绍一下修改方法。\n",
    "\n",
    "\n",
    "\n",
    "1.开始菜单-Anaconda文件夹-Anaconda Prompt，输入jupyter notebook --generate-config。\n",
    "\n",
    "2.在个人用户文件夹下找到.Jupyter文件夹，打开可以看到jupyter_notebook_config.py文件。\n",
    "\n",
    "3.用记事本或编辑器打开py文件，找到#c.NotebookApp.notebook_dir = ''，将这句话前面的“#”去掉，并改为c.NotebookApp.notebook_dir = 'D:\\ProgramData\\Jupyter'，单引号里面的路径是我的工作空间，根据自己需要修改，这个文件夹需要自己提前新建好。\n",
    "\n",
    "4.保存py文件，重启Jupyter Notebooks。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## bokeh.plotting绘图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"1001\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id != null && id in Bokeh.index) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var id = msg.content.text.trim();\n",
       "            if (id in Bokeh.index) {\n",
       "              Bokeh.index[id].model.document.clear();\n",
       "              delete Bokeh.index[id];\n",
       "            }\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "        toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[toinsert.length - 1]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"1001\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = css_urls.length + js_urls.length;\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }\n",
       "\n",
       "    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\": \"T2yuo9Oe71Cz/I4X9Ac5+gpEa5a8PpJCDlqKYO0CfAuEszu1JrXLl8YugMqYe3sM\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\": \"98GDGJ0kOMCUMUePhksaQ/GYgB3+NH9h996V88sh3aOiUNX3N+fLXAtry6xctSZ6\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\": \"89bArO+nlbP3sgakeHjCo1JYxYR5wufVgA3IbUvDY+K7w4zyxJqssu7wVnfeKCq8\"};\n",
       "\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      if (url in hashes) {\n",
       "        element.crossOrigin = \"anonymous\";\n",
       "        element.integrity = \"sha384-\" + hashes[url];\n",
       "      }\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  \n",
       "  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\"];\n",
       "  var css_urls = [];\n",
       "  \n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "    \n",
       "    \n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if (root.Bokeh !== undefined || force === true) {\n",
       "      \n",
       "    for (var i = 0; i < inline_js.length; i++) {\n",
       "      inline_js[i].call(root, root.Bokeh);\n",
       "    }\n",
       "    if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(css_urls, js_urls, function() {\n",
       "      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"1001\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }\n\n    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\": \"T2yuo9Oe71Cz/I4X9Ac5+gpEa5a8PpJCDlqKYO0CfAuEszu1JrXLl8YugMqYe3sM\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\": \"98GDGJ0kOMCUMUePhksaQ/GYgB3+NH9h996V88sh3aOiUNX3N+fLXAtry6xctSZ6\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\": \"89bArO+nlbP3sgakeHjCo1JYxYR5wufVgA3IbUvDY+K7w4zyxJqssu7wVnfeKCq8\"};\n\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      if (url in hashes) {\n        element.crossOrigin = \"anonymous\";\n        element.integrity = \"sha384-\" + hashes[url];\n      }\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n  };\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  \n  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\"];\n  var css_urls = [];\n  \n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    function(Bokeh) {\n    \n    \n    }\n  ];\n\n  function run_inline_js() {\n    \n    if (root.Bokeh !== undefined || force === true) {\n      \n    for (var i = 0; i < inline_js.length; i++) {\n      inline_js[i].call(root, root.Bokeh);\n    }\n    if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(css_urls, js_urls, function() {\n      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 导入库\n",
    "from bokeh.plotting import figure, output_notebook, show\n",
    "output_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"display: table;\"><div style=\"display: table-row;\"><div style=\"display: table-cell;\"><b title=\"bokeh.models.renderers.GlyphRenderer\">GlyphRenderer</b>(</div><div style=\"display: table-cell;\">id&nbsp;=&nbsp;'1036', <span id=\"1039\" style=\"cursor: pointer;\">&hellip;)</span></div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">data_source&nbsp;=&nbsp;ColumnDataSource(id='1033', ...),</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">glyph&nbsp;=&nbsp;Circle(id='1034', ...),</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">hover_glyph&nbsp;=&nbsp;None,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">js_event_callbacks&nbsp;=&nbsp;{},</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">js_property_callbacks&nbsp;=&nbsp;{},</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">level&nbsp;=&nbsp;'glyph',</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">muted&nbsp;=&nbsp;False,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">muted_glyph&nbsp;=&nbsp;None,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">name&nbsp;=&nbsp;None,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">nonselection_glyph&nbsp;=&nbsp;Circle(id='1035', ...),</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">selection_glyph&nbsp;=&nbsp;None,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">subscribed_events&nbsp;=&nbsp;[],</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">tags&nbsp;=&nbsp;[],</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">view&nbsp;=&nbsp;CDSView(id='1037', ...),</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">visible&nbsp;=&nbsp;True,</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">x_range_name&nbsp;=&nbsp;'default',</div></div><div class=\"1038\" style=\"display: none;\"><div style=\"display: table-cell;\"></div><div style=\"display: table-cell;\">y_range_name&nbsp;=&nbsp;'default')</div></div></div>\n",
       "<script>\n",
       "(function() {\n",
       "  var expanded = false;\n",
       "  var ellipsis = document.getElementById(\"1039\");\n",
       "  ellipsis.addEventListener(\"click\", function() {\n",
       "    var rows = document.getElementsByClassName(\"1038\");\n",
       "    for (var i = 0; i < rows.length; i++) {\n",
       "      var el = rows[i];\n",
       "      el.style.display = expanded ? \"none\" : \"table-row\";\n",
       "    }\n",
       "    ellipsis.innerHTML = expanded ? \"&hellip;)\" : \"&lsaquo;&lsaquo;&lsaquo;\";\n",
       "    expanded = !expanded;\n",
       "  });\n",
       "})();\n",
       "</script>\n"
      ],
      "text/plain": [
       "GlyphRenderer(id='1036', ...)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入数据\n",
    "x=[1,2,3,4,5]\n",
    "y=[6,8,2,4,4]\n",
    "# 画布：尺寸\n",
    "p=figure(plot_width=400,plot_height=400)\n",
    "p.circle(x,y,size=20,color=\"navy\",alpha=0.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"ba70783f-92c8-4ef4-8669-9010b7f062cf\" data-root-id=\"1002\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"3f417a82-f0d5-44fc-baf2-97c21b555905\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1011\"}],\"center\":[{\"id\":\"1014\"},{\"id\":\"1018\"}],\"left\":[{\"id\":\"1015\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1036\"}],\"title\":{\"id\":\"1041\"},\"toolbar\":{\"id\":\"1026\"},\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1007\"},\"y_range\":{\"id\":\"1005\"},\"y_scale\":{\"id\":\"1009\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1045\"},\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"1043\"},\"ticker\":{\"id\":\"1012\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1041\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"dimension\":1,\"ticker\":null},\"id\":\"1018\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1047\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1045\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"overlay\":{\"id\":\"1025\"}},\"id\":\"1021\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"HelpTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1021\"},{\"id\":\"1022\"},{\"id\":\"1023\"},{\"id\":\"1024\"}]},\"id\":\"1026\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"1033\"}},\"id\":\"1037\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1022\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1033\"},\"glyph\":{\"id\":\"1034\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1035\"},\"selection_glyph\":null,\"view\":{\"id\":\"1037\"}},\"id\":\"1036\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"navy\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1035\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1043\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1048\",\"type\":\"Selection\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1025\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"navy\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1034\",\"type\":\"Circle\"},{\"attributes\":{\"data\":{\"x\":[1,2,3,4,5],\"y\":[6,8,2,4,4]},\"selected\":{\"id\":\"1048\"},\"selection_policy\":{\"id\":\"1047\"}},\"id\":\"1033\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis\":{\"id\":\"1011\"},\"ticker\":null},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1003\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"PanTool\"}],\"root_ids\":[\"1002\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"3f417a82-f0d5-44fc-baf2-97c21b555905\",\"root_ids\":[\"1002\"],\"roots\":{\"1002\":\"ba70783f-92c8-4ef4-8669-9010b7f062cf\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1002"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#显示\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘图方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'Oval' is deprecated and will be removed in Bokeh 3.0, use the Ellipse glyph instead\n",
      "BokehDeprecationWarning: 'Oval' is deprecated and will be removed in Bokeh 3.0, use the Ellipse glyph instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"507e86ae-c4e7-46d8-87d0-bd187281a66a\" data-root-id=\"5202\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"f2bf9ca8-b737-4d07-9572-852cb5e99b29\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"5201\"},{\"id\":\"5199\"}]},\"id\":\"5202\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"4872\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4839\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"end_angle\":{\"units\":\"rad\",\"value\":4.1},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#DA70D6\"},\"line_width\":{\"value\":3},\"radius\":{\"units\":\"screen\",\"value\":20},\"start_angle\":{\"units\":\"rad\",\"value\":0.6},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4887\",\"type\":\"Arc\"},{\"attributes\":{\"axis\":{\"id\":\"4867\"},\"dimension\":1,\"ticker\":null},\"id\":\"4870\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4876\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5133\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4871\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5120\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4868\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5134\",\"type\":\"Selection\"},{\"attributes\":{\"overlay\":{\"id\":\"4877\"}},\"id\":\"4873\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4859\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"5122\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"4863\"},\"ticker\":null},\"id\":\"4866\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4874\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5160\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4801\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5161\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"5140\"},\"ticker\":{\"id\":\"4868\"}},\"id\":\"4867\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4944\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5174\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"5158\"},\"ticker\":{\"id\":\"4944\"}},\"id\":\"4943\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5176\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5124\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"5125\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4947\",\"type\":\"PanTool\"},{\"attributes\":{\"axis\":{\"id\":\"4939\"},\"ticker\":null},\"id\":\"4942\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4817\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"4943\"},\"dimension\":1,\"ticker\":null},\"id\":\"4946\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"4953\"}},\"id\":\"4949\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4937\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"5156\"},\"ticker\":{\"id\":\"4940\"}},\"id\":\"4939\",\"type\":\"LinearAxis\"},{\"attributes\":{\"below\":[{\"id\":\"4825\"}],\"center\":[{\"id\":\"4828\"},{\"id\":\"4832\"}],\"left\":[{\"id\":\"4829\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"4850\"}],\"title\":{\"id\":\"4815\"},\"toolbar\":{\"id\":\"4840\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4817\"},\"x_scale\":{\"id\":\"4821\"},\"y_range\":{\"id\":\"4819\"},\"y_scale\":{\"id\":\"4823\"}},\"id\":\"4814\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4940\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4948\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis\":{\"id\":\"5057\"},\"dimension\":1,\"ticker\":null},\"id\":\"5060\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5138\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"4809\"},\"glyph\":{\"id\":\"4810\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4811\"},\"selection_glyph\":null,\"view\":{\"id\":\"4813\"}},\"id\":\"4812\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4877\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"4809\"}},\"id\":\"4813\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5140\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"text\":\"annulus\"},\"id\":\"4815\",\"type\":\"Title\"},{\"attributes\":{\"end_angle\":{\"units\":\"rad\",\"value\":4.1},\"line_color\":{\"value\":\"#DA70D6\"},\"line_width\":{\"value\":3},\"radius\":{\"units\":\"screen\",\"value\":20},\"start_angle\":{\"units\":\"rad\",\"value\":0.6},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4886\",\"type\":\"Arc\"},{\"attributes\":{},\"id\":\"5178\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"formatter\":{\"id\":\"5129\"},\"ticker\":{\"id\":\"4826\"}},\"id\":\"4825\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5179\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4826\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5165\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4823\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4819\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"4838\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5167\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"5131\"},\"ticker\":{\"id\":\"4830\"}},\"id\":\"4829\",\"type\":\"LinearAxis\"},{\"attributes\":{\"below\":[{\"id\":\"4901\"}],\"center\":[{\"id\":\"4904\"},{\"id\":\"4908\"}],\"left\":[{\"id\":\"4905\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"4926\"}],\"title\":{\"id\":\"4891\"},\"toolbar\":{\"id\":\"4916\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4893\"},\"x_scale\":{\"id\":\"4897\"},\"y_range\":{\"id\":\"4895\"},\"y_scale\":{\"id\":\"4899\"}},\"id\":\"4890\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4821\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"4825\"},\"ticker\":null},\"id\":\"4828\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4893\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"4829\"},\"dimension\":1,\"ticker\":null},\"id\":\"4832\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4830\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4895\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"4847\"}},\"id\":\"4851\",\"type\":\"CDSView\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4833\"},{\"id\":\"4834\"},{\"id\":\"4835\"},{\"id\":\"4836\"},{\"id\":\"4837\"},{\"id\":\"4838\"}]},\"id\":\"4840\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5142\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4834\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4871\"},{\"id\":\"4872\"},{\"id\":\"4873\"},{\"id\":\"4874\"},{\"id\":\"4875\"},{\"id\":\"4876\"}]},\"id\":\"4878\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"4847\"},\"glyph\":{\"id\":\"4848\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4849\"},\"selection_glyph\":null,\"view\":{\"id\":\"4851\"}},\"id\":\"4850\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"5129\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4833\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5143\",\"type\":\"Selection\"},{\"attributes\":{\"overlay\":{\"id\":\"4839\"}},\"id\":\"4835\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"5183\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4836\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5131\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4837\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"4885\"},\"glyph\":{\"id\":\"4886\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4887\"},\"selection_glyph\":null,\"view\":{\"id\":\"4889\"}},\"id\":\"4888\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"5185\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"cx0\":{\"__ndarray__\":\"ZmZmZmZm/r9mZmZmZmb2v83MzMzMzOy/mpmZmZmZ2b+amZmZmZm5PzMzMzMzM+M/mpmZmZmZ8T+amZmZmZn5P83MzMzMzABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"cx1\":{\"__ndarray__\":\"zczMzMzMAMCamZmZmZn5v5qZmZmZmfG/MzMzMzMz47+amZmZmZm5v5qZmZmZmdk/zczMzMzM7D9mZmZmZmb2P2ZmZmZmZv4/\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"cy0\":{\"__ndarray__\":\"ZmZmZmZmEEDNzMzMzMwCQJqZmZmZmfE/ZmZmZmZm1j+amZmZmZm5P2ZmZmZmZtY/mpmZmZmZ8T/NzMzMzMwCQGZmZmZmZhBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"cy1\":{\"__ndarray__\":\"MzMzMzMzD0AzMzMzMzMBQM3MzMzMzOw/MzMzMzMzwz+amZmZmZm5vzMzMzMzM8M/zczMzMzM7D8zMzMzMzMBQDMzMzMzMw9A\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"x0\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"x1\":{\"__ndarray__\":\"zczMzMzM/L/NzMzMzMz0v5qZmZmZmem/MzMzMzMz07+amZmZmZnJP2ZmZmZmZuY/MzMzMzMz8z8zMzMzMzP7P5qZmZmZmQFA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y0\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y1\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5152\"},\"selection_policy\":{\"id\":\"5151\"}},\"id\":\"4923\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5161\"},\"selection_policy\":{\"id\":\"5160\"}},\"id\":\"4961\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4857\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"4885\"}},\"id\":\"4889\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5169\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"bezier\"},\"id\":\"4891\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"4864\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4798\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_color\":{\"value\":\"#3288BD\"},\"line_color\":{\"value\":\"#3288BD\"},\"radius\":{\"units\":\"data\",\"value\":0.2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4962\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5170\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4855\",\"type\":\"DataRange1d\"},{\"attributes\":{\"cx0\":{\"field\":\"cx0\"},\"cx1\":{\"field\":\"cx1\"},\"cy0\":{\"field\":\"cy0\"},\"cy1\":{\"field\":\"cy1\"},\"line_color\":{\"value\":\"#7B68EE\"},\"line_width\":{\"value\":3},\"x0\":{\"field\":\"x0\"},\"x1\":{\"field\":\"x1\"},\"y0\":{\"field\":\"y0\"},\"y1\":{\"field\":\"y1\"}},\"id\":\"4924\",\"type\":\"Bezier\"},{\"attributes\":{},\"id\":\"4875\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4902\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"5138\"},\"ticker\":{\"id\":\"4864\"}},\"id\":\"4863\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"5149\"},\"ticker\":{\"id\":\"4906\"}},\"id\":\"4905\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"5147\"},\"ticker\":{\"id\":\"4902\"}},\"id\":\"4901\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5143\"},\"selection_policy\":{\"id\":\"5142\"}},\"id\":\"4885\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5058\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4799\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4861\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4899\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"arc\"},\"id\":\"4853\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"4906\",\"type\":\"BasicTicker\"},{\"attributes\":{\"below\":[{\"id\":\"4863\"}],\"center\":[{\"id\":\"4866\"},{\"id\":\"4870\"}],\"left\":[{\"id\":\"4867\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"4888\"}],\"title\":{\"id\":\"4853\"},\"toolbar\":{\"id\":\"4878\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4855\"},\"x_scale\":{\"id\":\"4859\"},\"y_range\":{\"id\":\"4857\"},\"y_scale\":{\"id\":\"4861\"}},\"id\":\"4852\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"4897\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"4901\"},\"ticker\":null},\"id\":\"4904\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#808000\"},\"height\":{\"units\":\"screen\",\"value\":25},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#808000\"},\"width\":{\"units\":\"screen\",\"value\":15},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5077\",\"type\":\"Oval\"},{\"attributes\":{\"axis\":{\"id\":\"4905\"},\"dimension\":1,\"ticker\":null},\"id\":\"4908\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5007\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5009\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"4914\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5011\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"5174\"},\"ticker\":{\"id\":\"5016\"}},\"id\":\"5015\",\"type\":\"LinearAxis\"},{\"attributes\":{\"cx0\":{\"field\":\"cx0\"},\"cx1\":{\"field\":\"cx1\"},\"cy0\":{\"field\":\"cy0\"},\"cy1\":{\"field\":\"cy1\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7B68EE\"},\"line_width\":{\"value\":3},\"x0\":{\"field\":\"x0\"},\"x1\":{\"field\":\"x1\"},\"y0\":{\"field\":\"y0\"},\"y1\":{\"field\":\"y1\"}},\"id\":\"4925\",\"type\":\"Bezier\"},{\"attributes\":{\"formatter\":{\"id\":\"5176\"},\"ticker\":{\"id\":\"5020\"}},\"id\":\"5019\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4910\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5013\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"xs\":[{\"__ndarray__\":\"uB6F61G4AMD2KFyPwvUAwAAAAAAAAADAFK5H4XoU/r+PwvUoXI/+vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"cT0K16Nw+b/sUbgehev5vwAAAAAAAPi/FK5H4XoU9r+PwvUoXI/2vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"cT0K16Nw8b/sUbgehevxvwAAAAAAAPC/KVyPwvUo7L8fhetRuB7tvw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"4XoUrkfh4r/Xo3A9CtfjvwAAAAAAAOC/UrgehetR2L8+CtejcD3avw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"CtejcD0Kt7+4HoXrUbi+vwAAAAAAAAAAuB6F61G4vj8K16NwPQq3Pw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"PgrXo3A92j9SuB6F61HYPwAAAAAAAOA/16NwPQrX4z/hehSuR+HiPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"H4XrUbge7T8pXI/C9SjsPwAAAAAAAPA/7FG4HoXr8T9xPQrXo3DxPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"j8L1KFyP9j8UrkfhehT2PwAAAAAAAPg/7FG4HoXr+T9xPQrXo3D5Pw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"j8L1KFyP/j8UrkfhehT+PwAAAAAAAABA9ihcj8L1AEC4HoXrUbgAQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]}],\"ys\":[{\"__ndarray__\":\"MzMzMzMzD0AUrkfhehQQQGZmZmZmZhBAFK5H4XoUEEAzMzMzMzMPQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"MzMzMzMzAUApXI/C9SgCQM3MzMzMzAJAKVyPwvUoAkAzMzMzMzMBQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"zczMzMzM7D9SuB6F61HwP5qZmZmZmfE/UrgehetR8D/NzMzMzMzsPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"MzMzMzMzwz9I4XoUrkfRP2ZmZmZmZtY/SOF6FK5H0T8zMzMzMzPDPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"mpmZmZmZub97FK5H4XqUP5qZmZmZmbk/exSuR+F6lD+amZmZmZm5vw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"MzMzMzMzwz9I4XoUrkfRP2ZmZmZmZtY/SOF6FK5H0T8zMzMzMzPDPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"zczMzMzM7D9SuB6F61HwP5qZmZmZmfE/UrgehetR8D/NzMzMzMzsPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"MzMzMzMzAUApXI/C9SgCQM3MzMzMzAJAKVyPwvUoAkAzMzMzMzMBQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]},{\"__ndarray__\":\"MzMzMzMzD0AUrkfhehQQQGZmZmZmZhBAFK5H4XoUEEAzMzMzMzMPQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[5]}]},\"selected\":{\"id\":\"5179\"},\"selection_policy\":{\"id\":\"5178\"}},\"id\":\"5037\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4909\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5187\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"overlay\":{\"id\":\"4915\"}},\"id\":\"4911\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"text\":\"line\"},\"id\":\"4967\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"5016\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"4912\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"4969\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"5015\"},\"ticker\":null},\"id\":\"5018\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4913\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#3288BD\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#3288BD\"},\"radius\":{\"units\":\"data\",\"value\":0.2},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4963\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"5188\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"multi_line\"},\"id\":\"5005\",\"type\":\"Title\"},{\"attributes\":{\"axis\":{\"id\":\"5019\"},\"dimension\":1,\"ticker\":null},\"id\":\"5022\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"4961\"}},\"id\":\"4965\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5170\"},\"selection_policy\":{\"id\":\"5169\"}},\"id\":\"4999\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5020\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"4961\"},\"glyph\":{\"id\":\"4962\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4963\"},\"selection_glyph\":null,\"view\":{\"id\":\"4965\"}},\"id\":\"4964\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"5037\"},\"glyph\":{\"id\":\"5038\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5039\"},\"selection_glyph\":null,\"view\":{\"id\":\"5041\"}},\"id\":\"5040\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"4978\",\"type\":\"BasicTicker\"},{\"attributes\":{\"below\":[{\"id\":\"5053\"}],\"center\":[{\"id\":\"5056\"},{\"id\":\"5060\"}],\"left\":[{\"id\":\"5057\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"5078\"}],\"title\":{\"id\":\"5043\"},\"toolbar\":{\"id\":\"5068\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"5045\"},\"x_scale\":{\"id\":\"5049\"},\"y_range\":{\"id\":\"5047\"},\"y_scale\":{\"id\":\"5051\"}},\"id\":\"5042\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"5024\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5147\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"4990\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5023\",\"type\":\"PanTool\"},{\"attributes\":{\"source\":{\"id\":\"5075\"}},\"id\":\"5079\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"5029\"}},\"id\":\"5025\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4971\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"5075\"},\"glyph\":{\"id\":\"5076\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5077\"},\"selection_glyph\":null,\"view\":{\"id\":\"5079\"}},\"id\":\"5078\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"5026\",\"type\":\"SaveTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5165\"},\"ticker\":{\"id\":\"4978\"}},\"id\":\"4977\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5149\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5027\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"4975\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"5167\"},\"ticker\":{\"id\":\"4982\"}},\"id\":\"4981\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4973\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"4977\"},\"ticker\":null},\"id\":\"4980\",\"type\":\"Grid\"},{\"attributes\":{\"text\":\"patch\"},\"id\":\"5081\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5029\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"below\":[{\"id\":\"5091\"}],\"center\":[{\"id\":\"5094\"},{\"id\":\"5098\"}],\"left\":[{\"id\":\"5095\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"5116\"}],\"title\":{\"id\":\"5081\"},\"toolbar\":{\"id\":\"5106\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"5083\"},\"x_scale\":{\"id\":\"5087\"},\"y_range\":{\"id\":\"5085\"},\"y_scale\":{\"id\":\"5089\"}},\"id\":\"5080\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5067\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"5083\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4953\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4915\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"4981\"},\"dimension\":1,\"ticker\":null},\"id\":\"4984\",\"type\":\"Grid\"},{\"attributes\":{\"fill_color\":\"#F46D43\",\"line_color\":\"#F46D43\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5114\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"4982\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5092\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5104\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5085\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"4986\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5192\"},\"ticker\":{\"id\":\"5092\"}},\"id\":\"5091\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4985\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"5089\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"4991\"}},\"id\":\"4987\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5194\"},\"ticker\":{\"id\":\"5096\"}},\"id\":\"5095\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4988\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5087\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"4989\",\"type\":\"ResetTool\"},{\"attributes\":{\"axis\":{\"id\":\"5091\"},\"ticker\":null},\"id\":\"5094\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"5113\"}},\"id\":\"5117\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"5151\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"toolbar\":{\"id\":\"5200\"},\"toolbar_location\":\"above\"},\"id\":\"5201\",\"type\":\"ToolbarBox\"},{\"attributes\":{\"axis\":{\"id\":\"5095\"},\"dimension\":1,\"ticker\":null},\"id\":\"5098\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5096\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5152\",\"type\":\"Selection\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5099\"},{\"id\":\"5100\"},{\"id\":\"5101\"},{\"id\":\"5102\"},{\"id\":\"5103\"},{\"id\":\"5104\"}]},\"id\":\"5106\",\"type\":\"Toolbar\"},{\"attributes\":{\"text\":\"annular_wedge\"},\"id\":\"4777\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"5113\"},\"glyph\":{\"id\":\"5114\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5115\"},\"selection_glyph\":null,\"view\":{\"id\":\"5117\"}},\"id\":\"5116\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"5100\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"5192\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":0.1,\"fill_color\":\"#F46D43\",\"line_alpha\":0.1,\"line_color\":\"#F46D43\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5115\",\"type\":\"Patch\"},{\"attributes\":{},\"id\":\"5099\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"5105\"}},\"id\":\"5101\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4933\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5102\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"5194\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"5028\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5103\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5134\"},\"selection_policy\":{\"id\":\"5133\"}},\"id\":\"4847\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4909\"},{\"id\":\"4910\"},{\"id\":\"4911\"},{\"id\":\"4912\"},{\"id\":\"4913\"},{\"id\":\"4914\"}]},\"id\":\"4916\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5047\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"5037\"}},\"id\":\"5041\",\"type\":\"CDSView\"},{\"attributes\":{\"below\":[{\"id\":\"4787\"}],\"center\":[{\"id\":\"4790\"},{\"id\":\"4794\"}],\"left\":[{\"id\":\"4791\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"4812\"}],\"title\":{\"id\":\"4777\"},\"toolbar\":{\"id\":\"4802\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4779\"},\"x_scale\":{\"id\":\"4783\"},\"y_range\":{\"id\":\"4781\"},\"y_scale\":{\"id\":\"4785\"}},\"id\":\"4776\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5023\"},{\"id\":\"5024\"},{\"id\":\"5025\"},{\"id\":\"5026\"},{\"id\":\"5027\"},{\"id\":\"5028\"}]},\"id\":\"5030\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_color\":{\"value\":\"#7FFFAA\"},\"line_width\":{\"value\":2},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"5038\",\"type\":\"MultiLine\"},{\"attributes\":{\"formatter\":{\"id\":\"5183\"},\"ticker\":{\"id\":\"5054\"}},\"id\":\"5053\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"4923\"},\"glyph\":{\"id\":\"4924\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"4925\"},\"selection_glyph\":null,\"view\":{\"id\":\"4927\"}},\"id\":\"4926\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"4991\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"below\":[{\"id\":\"4939\"}],\"center\":[{\"id\":\"4942\"},{\"id\":\"4946\"}],\"left\":[{\"id\":\"4943\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"4964\"}],\"title\":{\"id\":\"4929\"},\"toolbar\":{\"id\":\"4954\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4931\"},\"x_scale\":{\"id\":\"4935\"},\"y_range\":{\"id\":\"4933\"},\"y_scale\":{\"id\":\"4937\"}},\"id\":\"4928\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7FFFAA\"},\"line_width\":{\"value\":2},\"xs\":{\"field\":\"xs\"},\"ys\":{\"field\":\"ys\"}},\"id\":\"5039\",\"type\":\"MultiLine\"},{\"attributes\":{},\"id\":\"5045\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"4923\"}},\"id\":\"4927\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_color\":{\"value\":\"#808000\"},\"height\":{\"units\":\"screen\",\"value\":25},\"line_color\":{\"value\":\"#808000\"},\"width\":{\"units\":\"screen\",\"value\":15},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5076\",\"type\":\"Oval\"},{\"attributes\":{\"data_source\":{\"id\":\"4999\"},\"glyph\":{\"id\":\"5000\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"5001\"},\"selection_glyph\":null,\"view\":{\"id\":\"5003\"}},\"id\":\"5002\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"text\":\"circle\"},\"id\":\"4929\",\"type\":\"Title\"},{\"attributes\":{\"text\":\"oval\"},\"id\":\"5043\",\"type\":\"Title\"},{\"attributes\":{\"below\":[{\"id\":\"5015\"}],\"center\":[{\"id\":\"5018\"},{\"id\":\"5022\"}],\"left\":[{\"id\":\"5019\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"5040\"}],\"title\":{\"id\":\"5005\"},\"toolbar\":{\"id\":\"5030\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"5007\"},\"x_scale\":{\"id\":\"5011\"},\"y_range\":{\"id\":\"5009\"},\"y_scale\":{\"id\":\"5013\"}},\"id\":\"5004\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"end_angle\":{\"units\":\"rad\",\"value\":4.1},\"fill_color\":{\"value\":\"#8888ee\"},\"inner_radius\":{\"units\":\"screen\",\"value\":10},\"line_color\":{\"value\":\"#8888ee\"},\"outer_radius\":{\"units\":\"screen\",\"value\":20},\"start_angle\":{\"units\":\"rad\",\"value\":0.6},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4810\",\"type\":\"AnnularWedge\"},{\"attributes\":{},\"id\":\"5054\",\"type\":\"BasicTicker\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"5061\"},{\"id\":\"5062\"},{\"id\":\"5063\"},{\"id\":\"5064\"},{\"id\":\"5065\"},{\"id\":\"5066\"}]},\"id\":\"5068\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"4931\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#7FC97F\"},\"inner_radius\":{\"units\":\"screen\",\"value\":10},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#7FC97F\"},\"outer_radius\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4849\",\"type\":\"Annulus\"},{\"attributes\":{\"below\":[{\"id\":\"4977\"}],\"center\":[{\"id\":\"4980\"},{\"id\":\"4984\"}],\"left\":[{\"id\":\"4981\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"5002\"}],\"title\":{\"id\":\"4967\"},\"toolbar\":{\"id\":\"4992\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"4969\"},\"x_scale\":{\"id\":\"4973\"},\"y_range\":{\"id\":\"4971\"},\"y_scale\":{\"id\":\"4975\"}},\"id\":\"4966\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"formatter\":{\"id\":\"5122\"},\"ticker\":{\"id\":\"4792\"}},\"id\":\"4791\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4950\",\"type\":\"SaveTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4795\"},{\"id\":\"4796\"},{\"id\":\"4797\"},{\"id\":\"4798\"},{\"id\":\"4799\"},{\"id\":\"4800\"}]},\"id\":\"4802\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5051\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"5185\"},\"ticker\":{\"id\":\"5058\"}},\"id\":\"5057\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"4952\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"5049\",\"type\":\"LinearScale\"},{\"attributes\":{\"end_angle\":{\"units\":\"rad\",\"value\":4.1},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#8888ee\"},\"inner_radius\":{\"units\":\"screen\",\"value\":10},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#8888ee\"},\"outer_radius\":{\"units\":\"screen\",\"value\":20},\"start_angle\":{\"units\":\"rad\",\"value\":0.6},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4811\",\"type\":\"AnnularWedge\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4947\"},{\"id\":\"4948\"},{\"id\":\"4949\"},{\"id\":\"4950\"},{\"id\":\"4951\"},{\"id\":\"4952\"}]},\"id\":\"4954\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"5053\"},\"ticker\":null},\"id\":\"5056\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5105\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"4779\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#7FC97F\"},\"inner_radius\":{\"units\":\"screen\",\"value\":10},\"line_color\":{\"value\":\"#7FC97F\"},\"outer_radius\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4848\",\"type\":\"Annulus\"},{\"attributes\":{},\"id\":\"5196\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"4935\",\"type\":\"LinearScale\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5125\"},\"selection_policy\":{\"id\":\"5124\"}},\"id\":\"4809\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5197\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"4788\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5197\"},\"selection_policy\":{\"id\":\"5196\"}},\"id\":\"5113\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4800\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"4951\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"5066\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"4781\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"5062\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"5120\"},\"ticker\":{\"id\":\"4788\"}},\"id\":\"4787\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"5061\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"4785\",\"type\":\"LinearScale\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#87CEFA\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5001\",\"type\":\"Line\"},{\"attributes\":{\"overlay\":{\"id\":\"5067\"}},\"id\":\"5063\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"4783\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"5064\",\"type\":\"SaveTool\"},{\"attributes\":{\"axis\":{\"id\":\"4787\"},\"ticker\":null},\"id\":\"4790\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"5065\",\"type\":\"ResetTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4985\"},{\"id\":\"4986\"},{\"id\":\"4987\"},{\"id\":\"4988\"},{\"id\":\"4989\"},{\"id\":\"4990\"}]},\"id\":\"4992\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"5156\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"4791\"},\"dimension\":1,\"ticker\":null},\"id\":\"4794\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4792\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"5158\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"AAAAAAAAAMAAAAAAAAD4vwAAAAAAAPC/AAAAAAAA4L8AAAAAAAAAAAAAAAAAAOA/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAABA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]},\"y\":{\"__ndarray__\":\"AAAAAAAAEEAAAAAAAAACQAAAAAAAAPA/AAAAAAAA0D8AAAAAAAAAAAAAAAAAANA/AAAAAAAA8D8AAAAAAAACQAAAAAAAABBA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[9]}},\"selected\":{\"id\":\"5188\"},\"selection_policy\":{\"id\":\"5187\"}},\"id\":\"5075\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"4796\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"source\":{\"id\":\"4999\"}},\"id\":\"5003\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"4795\",\"type\":\"PanTool\"},{\"attributes\":{\"line_color\":\"#87CEFA\",\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5000\",\"type\":\"Line\"},{\"attributes\":{\"overlay\":{\"id\":\"4801\"}},\"id\":\"4797\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"children\":[[{\"id\":\"4776\"},0,0],[{\"id\":\"4814\"},0,1],[{\"id\":\"4852\"},0,2],[{\"id\":\"4890\"},0,3],[{\"id\":\"4928\"},1,0],[{\"id\":\"4966\"},1,1],[{\"id\":\"5004\"},1,2],[{\"id\":\"5042\"},1,3],[{\"id\":\"5080\"},2,0]]},\"id\":\"5199\",\"type\":\"GridBox\"},{\"attributes\":{\"toolbars\":[{\"id\":\"4802\"},{\"id\":\"4840\"},{\"id\":\"4878\"},{\"id\":\"4916\"},{\"id\":\"4954\"},{\"id\":\"4992\"},{\"id\":\"5030\"},{\"id\":\"5068\"},{\"id\":\"5106\"}],\"tools\":[{\"id\":\"4795\"},{\"id\":\"4796\"},{\"id\":\"4797\"},{\"id\":\"4798\"},{\"id\":\"4799\"},{\"id\":\"4800\"},{\"id\":\"4833\"},{\"id\":\"4834\"},{\"id\":\"4835\"},{\"id\":\"4836\"},{\"id\":\"4837\"},{\"id\":\"4838\"},{\"id\":\"4871\"},{\"id\":\"4872\"},{\"id\":\"4873\"},{\"id\":\"4874\"},{\"id\":\"4875\"},{\"id\":\"4876\"},{\"id\":\"4909\"},{\"id\":\"4910\"},{\"id\":\"4911\"},{\"id\":\"4912\"},{\"id\":\"4913\"},{\"id\":\"4914\"},{\"id\":\"4947\"},{\"id\":\"4948\"},{\"id\":\"4949\"},{\"id\":\"4950\"},{\"id\":\"4951\"},{\"id\":\"4952\"},{\"id\":\"4985\"},{\"id\":\"4986\"},{\"id\":\"4987\"},{\"id\":\"4988\"},{\"id\":\"4989\"},{\"id\":\"4990\"},{\"id\":\"5023\"},{\"id\":\"5024\"},{\"id\":\"5025\"},{\"id\":\"5026\"},{\"id\":\"5027\"},{\"id\":\"5028\"},{\"id\":\"5061\"},{\"id\":\"5062\"},{\"id\":\"5063\"},{\"id\":\"5064\"},{\"id\":\"5065\"},{\"id\":\"5066\"},{\"id\":\"5099\"},{\"id\":\"5100\"},{\"id\":\"5101\"},{\"id\":\"5102\"},{\"id\":\"5103\"},{\"id\":\"5104\"}]},\"id\":\"5200\",\"type\":\"ProxyToolbar\"}],\"root_ids\":[\"5202\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"f2bf9ca8-b737-4d07-9572-852cb5e99b29\",\"root_ids\":[\"5202\"],\"roots\":{\"5202\":\"507e86ae-c4e7-46d8-87d0-bd187281a66a\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "5202"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np ###产生矩阵\n",
    "from bokeh.layouts import gridplot\n",
    "\n",
    "### 数据\n",
    "N=9    ###点\n",
    "x=np.linspace(-2, 2, N)\n",
    "y=x**2\n",
    "### 矩阵坐标\n",
    "sizes = np.linspace(10, 20, N)\n",
    "xpts = np.array([-.09, -.12, .0, .12, .09])\n",
    "ypts = np.array([-.1, .02, .1, .02, -.1])\n",
    "\n",
    "###画布列表\n",
    "figures=[]\n",
    "\n",
    "### 画布 图1 annular_wedge图\n",
    "p = figure(title=\"annular_wedge\")\n",
    "# p = figure(title=\"annular_wedge\",plot_width=400,plot_height=400)\n",
    "\n",
    "### 绘制\n",
    "p.annular_wedge(x, y, 10, 20, 0.6, 4.1, \n",
    "                color=\"#8888ee\",\n",
    "                inner_radius_units=\"screen\", \n",
    "                outer_radius_units=\"screen\")\n",
    "### 添加至列表\n",
    "figures.append(p)\n",
    "\n",
    "### 图2   annulus图\n",
    "p = figure(title='annulus')\n",
    "p.annulus(x, y, 10, 20,  \n",
    "          color=\"#7FC97F\",\n",
    "          inner_radius_units=\"screen\", \n",
    "          outer_radius_units=\"screen\")\n",
    "figures.append(p)\n",
    "### 图3 arc 图\n",
    "p = figure(title=\"arc\")\n",
    "p.arc(x, y,20, 0.6, 4.1,\n",
    "      radius_units = \"screen\" , \n",
    "      color=\"#DA70D6\",line_width=3)\n",
    "figures.append(p)\n",
    "# 图4 bezier图\n",
    "p = figure(title= \"bezier\")\n",
    "p.bezier(x, y, x+0.2, y, x+0.1, y+0.1,x-0.1, y-0.1,color=\"#7B68EE\", line_width=3)\n",
    "figures.append(p)\n",
    "\n",
    "# 图5 circle图\n",
    "p = figure(title=\"circle\")\n",
    "p.circle(x, y, radius=0.2, \n",
    "         color=\"#3288BD\")\n",
    "figures.append(p)\n",
    "\n",
    "# 图6 line图\n",
    "p = figure(title=\"line\")\n",
    "p.line(x, y, \n",
    "       color= \"#87CEFA\")\n",
    "figures.append(p)\n",
    "\n",
    "# 图7 multi_line图\n",
    "p = figure(title= \"multi_line\")\n",
    "p.multi_line([xpts+xx for xx in x],[ypts+yy for yy in y], \n",
    "             color=\"#7FFFAA\",\n",
    "             line_width=2)\n",
    "figures.append(p)\n",
    "\n",
    "# 图8 oval图\n",
    "p = figure(title=\"oval\")\n",
    "p.oval(x,y,15,25, angle=0, \n",
    "       color=\"#808000\",\n",
    "       width_units=\"screen\", \n",
    "       height_units=\"screen\")\n",
    "figures.append(p)\n",
    "\n",
    "# 图9 patch图\n",
    "p = figure(title=\"patch\" )\n",
    "p.patch(x,y,color=\"#F46D43\")\n",
    "figures.append(p)\n",
    "### 显示图版\n",
    "show(gridplot(figures,ncols=4,plot_width=300,plot_height=300))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 机器学习结合 BOekh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### 此处用到Scikit-learn官网的鸢尾花数据集作为数据源进行展示，Scikit-learn简介 [点击了解](https://blog.csdn.net/Treasure99/article/details/106081404?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164662748016780269864847%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164662748016780269864847&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_click~default-2-106081404.pc_search_result_control_group&utm_term=Scikit-learn&spm=1018.2226.3001.4187)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 鸢尾花数据集简介\n",
    "鸢尾花数据集\n",
    "在Sklearn机器学习包中，集成了各种各样的数据集，包括前面的糖尿病数据集，这里引入的是鸢尾花卉（Iris）数据集，它是很常用的一个数据集。鸢尾花有三个亚属，分别是山鸢尾（Iris-setosa）、变色鸢尾（Iris-versicolor）和维吉尼亚鸢尾（Iris-virginica）\n",
    "该数据集一共包含4个特征变量，1个类别变量。共有150个样本，iris是鸢尾植物，这里存储了其萼片和花瓣的长宽，共4个属性，鸢尾植物分三类。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "iris里有两个属性iris.data，iris.target。data是一个矩阵，每一列代表了萼片或花瓣的长宽，一共4列，每一行代表某个被测量的鸢尾植物，一共采样了150条记录。\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"2d8cb5eb-7d4c-4885-b3d6-83a893ad7595\" data-root-id=\"6780\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"06ff9ff8-2f81-42a3-b772-653e71e54ce9\":{\"roots\":{\"references\":[{\"attributes\":{\"background_fill_color\":\"#fafafa\",\"below\":[{\"id\":\"6791\"}],\"center\":[{\"id\":\"6794\"},{\"id\":\"6798\"},{\"id\":\"6829\"}],\"left\":[{\"id\":\"6795\"}],\"renderers\":[{\"id\":\"6819\"}],\"title\":{\"id\":\"6781\"},\"toolbar\":{\"id\":\"6806\"},\"x_range\":{\"id\":\"6783\"},\"x_scale\":{\"id\":\"6787\"},\"y_range\":{\"id\":\"6785\"},\"y_scale\":{\"id\":\"6789\"}},\"id\":\"6780\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"6783\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],\"petal_length\":{\"__ndarray__\":\"ZmZmZmZm9j9mZmZmZmb2P83MzMzMzPQ/AAAAAAAA+D9mZmZmZmb2PzMzMzMzM/s/ZmZmZmZm9j8AAAAAAAD4P2ZmZmZmZvY/AAAAAAAA+D8AAAAAAAD4P5qZmZmZmfk/ZmZmZmZm9j+amZmZmZnxPzMzMzMzM/M/AAAAAAAA+D/NzMzMzMz0P2ZmZmZmZvY/MzMzMzMz+z8AAAAAAAD4PzMzMzMzM/s/AAAAAAAA+D8AAAAAAADwPzMzMzMzM/s/ZmZmZmZm/j+amZmZmZn5P5qZmZmZmfk/AAAAAAAA+D9mZmZmZmb2P5qZmZmZmfk/mpmZmZmZ+T8AAAAAAAD4PwAAAAAAAPg/ZmZmZmZm9j8AAAAAAAD4PzMzMzMzM/M/zczMzMzM9D9mZmZmZmb2P83MzMzMzPQ/AAAAAAAA+D/NzMzMzMz0P83MzMzMzPQ/zczMzMzM9D+amZmZmZn5P2ZmZmZmZv4/ZmZmZmZm9j+amZmZmZn5P2ZmZmZmZvY/AAAAAAAA+D9mZmZmZmb2P83MzMzMzBJAAAAAAAAAEkCamZmZmZkTQAAAAAAAABBAZmZmZmZmEkAAAAAAAAASQM3MzMzMzBJAZmZmZmZmCkBmZmZmZmYSQDMzMzMzMw9AAAAAAAAADEDNzMzMzMwQQAAAAAAAABBAzczMzMzMEkDNzMzMzMwMQJqZmZmZmRFAAAAAAAAAEkBmZmZmZmYQQAAAAAAAABJAMzMzMzMzD0AzMzMzMzMTQAAAAAAAABBAmpmZmZmZE0DNzMzMzMwSQDMzMzMzMxFAmpmZmZmZEUAzMzMzMzMTQAAAAAAAABRAAAAAAAAAEkAAAAAAAAAMQGZmZmZmZg5AmpmZmZmZDUAzMzMzMzMPQGZmZmZmZhRAAAAAAAAAEkAAAAAAAAASQM3MzMzMzBJAmpmZmZmZEUBmZmZmZmYQQAAAAAAAABBAmpmZmZmZEUBmZmZmZmYSQAAAAAAAABBAZmZmZmZmCkDNzMzMzMwQQM3MzMzMzBBAzczMzMzMEEAzMzMzMzMRQAAAAAAAAAhAZmZmZmZmEEAAAAAAAAAYQGZmZmZmZhRAmpmZmZmZF0BmZmZmZmYWQDMzMzMzMxdAZmZmZmZmGkAAAAAAAAASQDMzMzMzMxlAMzMzMzMzF0BmZmZmZmYYQGZmZmZmZhRAMzMzMzMzFUAAAAAAAAAWQAAAAAAAABRAZmZmZmZmFEAzMzMzMzMVQAAAAAAAABZAzczMzMzMGkCamZmZmZkbQAAAAAAAABRAzczMzMzMFkCamZmZmZkTQM3MzMzMzBpAmpmZmZmZE0DNzMzMzMwWQAAAAAAAABhAMzMzMzMzE0CamZmZmZkTQGZmZmZmZhZAMzMzMzMzF0BmZmZmZmYYQJqZmZmZmRlAZmZmZmZmFkBmZmZmZmYUQGZmZmZmZhZAZmZmZmZmGEBmZmZmZmYWQAAAAAAAABZAMzMzMzMzE0CamZmZmZkVQGZmZmZmZhZAZmZmZmZmFEBmZmZmZmYUQJqZmZmZmRdAzczMzMzMFkDNzMzMzMwUQAAAAAAAABRAzczMzMzMFECamZmZmZkVQGZmZmZmZhRA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[150]},\"petal_width\":{\"__ndarray__\":\"mpmZmZmZyT+amZmZmZnJP5qZmZmZmck/mpmZmZmZyT+amZmZmZnJP5qZmZmZmdk/MzMzMzMz0z+amZmZmZnJP5qZmZmZmck/mpmZmZmZuT+amZmZmZnJP5qZmZmZmck/mpmZmZmZuT+amZmZmZm5P5qZmZmZmck/mpmZmZmZ2T+amZmZmZnZPzMzMzMzM9M/MzMzMzMz0z8zMzMzMzPTP5qZmZmZmck/mpmZmZmZ2T+amZmZmZnJPwAAAAAAAOA/mpmZmZmZyT+amZmZmZnJP5qZmZmZmdk/mpmZmZmZyT+amZmZmZnJP5qZmZmZmck/mpmZmZmZyT+amZmZmZnZP5qZmZmZmbk/mpmZmZmZyT+amZmZmZnJP5qZmZmZmck/mpmZmZmZyT+amZmZmZm5P5qZmZmZmck/mpmZmZmZyT8zMzMzMzPTPzMzMzMzM9M/mpmZmZmZyT8zMzMzMzPjP5qZmZmZmdk/MzMzMzMz0z+amZmZmZnJP5qZmZmZmck/mpmZmZmZyT+amZmZmZnJP2ZmZmZmZvY/AAAAAAAA+D8AAAAAAAD4P83MzMzMzPQ/AAAAAAAA+D/NzMzMzMz0P5qZmZmZmfk/AAAAAAAA8D/NzMzMzMz0P2ZmZmZmZvY/AAAAAAAA8D8AAAAAAAD4PwAAAAAAAPA/ZmZmZmZm9j/NzMzMzMz0P2ZmZmZmZvY/AAAAAAAA+D8AAAAAAADwPwAAAAAAAPg/mpmZmZmZ8T/NzMzMzMz8P83MzMzMzPQ/AAAAAAAA+D8zMzMzMzPzP83MzMzMzPQ/ZmZmZmZm9j9mZmZmZmb2PzMzMzMzM/s/AAAAAAAA+D8AAAAAAADwP5qZmZmZmfE/AAAAAAAA8D8zMzMzMzPzP5qZmZmZmfk/AAAAAAAA+D+amZmZmZn5PwAAAAAAAPg/zczMzMzM9D/NzMzMzMz0P83MzMzMzPQ/MzMzMzMz8z9mZmZmZmb2PzMzMzMzM/M/AAAAAAAA8D/NzMzMzMz0PzMzMzMzM/M/zczMzMzM9D/NzMzMzMz0P5qZmZmZmfE/zczMzMzM9D8AAAAAAAAEQGZmZmZmZv4/zczMzMzMAEDNzMzMzMz8P5qZmZmZmQFAzczMzMzMAEAzMzMzMzP7P83MzMzMzPw/zczMzMzM/D8AAAAAAAAEQAAAAAAAAABAZmZmZmZm/j/NzMzMzMwAQAAAAAAAAABAMzMzMzMzA0BmZmZmZmYCQM3MzMzMzPw/mpmZmZmZAUBmZmZmZmYCQAAAAAAAAPg/ZmZmZmZmAkAAAAAAAAAAQAAAAAAAAABAzczMzMzM/D/NzMzMzMwAQM3MzMzMzPw/zczMzMzM/D/NzMzMzMz8P83MzMzMzABAmpmZmZmZ+T9mZmZmZmb+PwAAAAAAAABAmpmZmZmZAUAAAAAAAAD4P2ZmZmZmZvY/ZmZmZmZmAkAzMzMzMzMDQM3MzMzMzPw/zczMzMzM/D/NzMzMzMwAQDMzMzMzMwNAZmZmZmZmAkBmZmZmZmb+P2ZmZmZmZgJAAAAAAAAABEBmZmZmZmYCQGZmZmZmZv4/AAAAAAAAAEBmZmZmZmYCQM3MzMzMzPw/\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[150]},\"sepal_length\":{\"__ndarray__\":\"ZmZmZmZmFECamZmZmZkTQM3MzMzMzBJAZmZmZmZmEkAAAAAAAAAUQJqZmZmZmRVAZmZmZmZmEkAAAAAAAAAUQJqZmZmZmRFAmpmZmZmZE0CamZmZmZkVQDMzMzMzMxNAMzMzMzMzE0AzMzMzMzMRQDMzMzMzMxdAzczMzMzMFkCamZmZmZkVQGZmZmZmZhRAzczMzMzMFkBmZmZmZmYUQJqZmZmZmRVAZmZmZmZmFEBmZmZmZmYSQGZmZmZmZhRAMzMzMzMzE0AAAAAAAAAUQAAAAAAAABRAzczMzMzMFEDNzMzMzMwUQM3MzMzMzBJAMzMzMzMzE0CamZmZmZkVQM3MzMzMzBRAAAAAAAAAFkCamZmZmZkTQAAAAAAAABRAAAAAAAAAFkCamZmZmZkTQJqZmZmZmRFAZmZmZmZmFEAAAAAAAAAUQAAAAAAAABJAmpmZmZmZEUAAAAAAAAAUQGZmZmZmZhRAMzMzMzMzE0BmZmZmZmYUQGZmZmZmZhJAMzMzMzMzFUAAAAAAAAAUQAAAAAAAABxAmpmZmZmZGUCamZmZmZkbQAAAAAAAABZAAAAAAAAAGkDNzMzMzMwWQDMzMzMzMxlAmpmZmZmZE0BmZmZmZmYaQM3MzMzMzBRAAAAAAAAAFECamZmZmZkXQAAAAAAAABhAZmZmZmZmGEBmZmZmZmYWQM3MzMzMzBpAZmZmZmZmFkAzMzMzMzMXQM3MzMzMzBhAZmZmZmZmFkCamZmZmZkXQGZmZmZmZhhAMzMzMzMzGUBmZmZmZmYYQJqZmZmZmRlAZmZmZmZmGkAzMzMzMzMbQM3MzMzMzBpAAAAAAAAAGEDNzMzMzMwWQAAAAAAAABZAAAAAAAAAFkAzMzMzMzMXQAAAAAAAABhAmpmZmZmZFUAAAAAAAAAYQM3MzMzMzBpAMzMzMzMzGUBmZmZmZmYWQAAAAAAAABZAAAAAAAAAFkBmZmZmZmYYQDMzMzMzMxdAAAAAAAAAFEBmZmZmZmYWQM3MzMzMzBZAzczMzMzMFkDNzMzMzMwYQGZmZmZmZhRAzczMzMzMFkAzMzMzMzMZQDMzMzMzMxdAZmZmZmZmHEAzMzMzMzMZQAAAAAAAABpAZmZmZmZmHkCamZmZmZkTQDMzMzMzMx1AzczMzMzMGkDNzMzMzMwcQAAAAAAAABpAmpmZmZmZGUAzMzMzMzMbQM3MzMzMzBZAMzMzMzMzF0CamZmZmZkZQAAAAAAAABpAzczMzMzMHkDNzMzMzMweQAAAAAAAABhAmpmZmZmZG0BmZmZmZmYWQM3MzMzMzB5AMzMzMzMzGUDNzMzMzMwaQM3MzMzMzBxAzczMzMzMGEBmZmZmZmYYQJqZmZmZmRlAzczMzMzMHECamZmZmZkdQJqZmZmZmR9AmpmZmZmZGUAzMzMzMzMZQGZmZmZmZhhAzczMzMzMHkAzMzMzMzMZQJqZmZmZmRlAAAAAAAAAGECamZmZmZkbQM3MzMzMzBpAmpmZmZmZG0AzMzMzMzMXQDMzMzMzMxtAzczMzMzMGkDNzMzMzMwaQDMzMzMzMxlAAAAAAAAAGkDNzMzMzMwYQJqZmZmZmRdA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[150]},\"sepal_width\":{\"__ndarray__\":\"AAAAAAAADEAAAAAAAAAIQJqZmZmZmQlAzczMzMzMCEDNzMzMzMwMQDMzMzMzMw9AMzMzMzMzC0AzMzMzMzMLQDMzMzMzMwdAzczMzMzMCECamZmZmZkNQDMzMzMzMwtAAAAAAAAACEAAAAAAAAAIQAAAAAAAABBAmpmZmZmZEUAzMzMzMzMPQAAAAAAAAAxAZmZmZmZmDkBmZmZmZmYOQDMzMzMzMwtAmpmZmZmZDUDNzMzMzMwMQGZmZmZmZgpAMzMzMzMzC0AAAAAAAAAIQDMzMzMzMwtAAAAAAAAADEAzMzMzMzMLQJqZmZmZmQlAzczMzMzMCEAzMzMzMzMLQGZmZmZmZhBAzczMzMzMEEDNzMzMzMwIQJqZmZmZmQlAAAAAAAAADEDNzMzMzMwMQAAAAAAAAAhAMzMzMzMzC0AAAAAAAAAMQGZmZmZmZgJAmpmZmZmZCUAAAAAAAAAMQGZmZmZmZg5AAAAAAAAACEBmZmZmZmYOQJqZmZmZmQlAmpmZmZmZDUBmZmZmZmYKQJqZmZmZmQlAmpmZmZmZCUDNzMzMzMwIQGZmZmZmZgJAZmZmZmZmBkBmZmZmZmYGQGZmZmZmZgpAMzMzMzMzA0AzMzMzMzMHQJqZmZmZmQVAAAAAAAAAAEAAAAAAAAAIQJqZmZmZmQFAMzMzMzMzB0AzMzMzMzMHQM3MzMzMzAhAAAAAAAAACECamZmZmZkFQJqZmZmZmQFAAAAAAAAABECamZmZmZkJQGZmZmZmZgZAAAAAAAAABEBmZmZmZmYGQDMzMzMzMwdAAAAAAAAACEBmZmZmZmYGQAAAAAAAAAhAMzMzMzMzB0DNzMzMzMwEQDMzMzMzMwNAMzMzMzMzA0CamZmZmZkFQJqZmZmZmQVAAAAAAAAACEAzMzMzMzMLQM3MzMzMzAhAZmZmZmZmAkAAAAAAAAAIQAAAAAAAAARAzczMzMzMBEAAAAAAAAAIQM3MzMzMzARAZmZmZmZmAkCamZmZmZkFQAAAAAAAAAhAMzMzMzMzB0AzMzMzMzMHQAAAAAAAAARAZmZmZmZmBkBmZmZmZmYKQJqZmZmZmQVAAAAAAAAACEAzMzMzMzMHQAAAAAAAAAhAAAAAAAAACEAAAAAAAAAEQDMzMzMzMwdAAAAAAAAABEDNzMzMzMwMQJqZmZmZmQlAmpmZmZmZBUAAAAAAAAAIQAAAAAAAAARAZmZmZmZmBkCamZmZmZkJQAAAAAAAAAhAZmZmZmZmDkDNzMzMzMwEQJqZmZmZmQFAmpmZmZmZCUBmZmZmZmYGQGZmZmZmZgZAmpmZmZmZBUBmZmZmZmYKQJqZmZmZmQlAZmZmZmZmBkAAAAAAAAAIQGZmZmZmZgZAAAAAAAAACEBmZmZmZmYGQGZmZmZmZg5AZmZmZmZmBkBmZmZmZmYGQM3MzMzMzARAAAAAAAAACEAzMzMzMzMLQM3MzMzMzAhAAAAAAAAACEDNzMzMzMwIQM3MzMzMzAhAzczMzMzMCECamZmZmZkFQJqZmZmZmQlAZmZmZmZmCkAAAAAAAAAIQAAAAAAAAARAAAAAAAAACEAzMzMzMzMLQAAAAAAAAAhA\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[150]},\"species\":[\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"setosa\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"versicolor\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\",\"virginica\"]},\"selected\":{\"id\":\"6828\"},\"selection_policy\":{\"id\":\"6827\"}},\"id\":\"6815\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"6805\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis\":{\"id\":\"6795\"},\"dimension\":1,\"ticker\":null},\"id\":\"6798\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"6815\"}},\"id\":\"6820\",\"type\":\"CDSView\"},{\"attributes\":{\"factors\":[\"setosa\",\"versicolor\",\"virginica\"],\"markers\":[\"hex\",\"circle_x\",\"triangle\"]},\"id\":\"6813\",\"type\":\"CategoricalMarkerMapper\"},{\"attributes\":{},\"id\":\"6823\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"6799\"},{\"id\":\"6800\"},{\"id\":\"6801\"},{\"id\":\"6802\"},{\"id\":\"6803\"},{\"id\":\"6804\"}]},\"id\":\"6806\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"6804\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"6792\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"6825\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"field\":\"species\"},\"renderers\":[{\"id\":\"6819\"}]},\"id\":\"6830\",\"type\":\"LegendItem\"},{\"attributes\":{\"text\":\"Iris Morphology\"},\"id\":\"6781\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"6789\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"6787\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"6791\"},\"ticker\":null},\"id\":\"6794\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"6796\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"6815\"},\"glyph\":{\"id\":\"6817\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"6818\"},\"selection_glyph\":null,\"view\":{\"id\":\"6820\"}},\"id\":\"6819\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"6805\"}},\"id\":\"6801\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"species\",\"transform\":{\"id\":\"6814\"}},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"species\",\"transform\":{\"id\":\"6814\"}},\"marker\":{\"field\":\"species\",\"transform\":{\"id\":\"6813\"}},\"size\":{\"units\":\"screen\",\"value\":12},\"x\":{\"field\":\"petal_length\"},\"y\":{\"field\":\"sepal_width\"}},\"id\":\"6818\",\"type\":\"Scatter\"},{\"attributes\":{\"items\":[{\"id\":\"6830\"}]},\"id\":\"6829\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"6800\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis_label\":\"Petal Length\",\"formatter\":{\"id\":\"6823\"},\"ticker\":{\"id\":\"6792\"}},\"id\":\"6791\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"6799\",\"type\":\"PanTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"field\":\"species\",\"transform\":{\"id\":\"6814\"}},\"line_color\":{\"field\":\"species\",\"transform\":{\"id\":\"6814\"}},\"marker\":{\"field\":\"species\",\"transform\":{\"id\":\"6813\"}},\"size\":{\"units\":\"screen\",\"value\":12},\"x\":{\"field\":\"petal_length\"},\"y\":{\"field\":\"sepal_width\"}},\"id\":\"6817\",\"type\":\"Scatter\"},{\"attributes\":{\"axis_label\":\"Petal Length\",\"formatter\":{\"id\":\"6825\"},\"ticker\":{\"id\":\"6796\"}},\"id\":\"6795\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"6827\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"6785\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"6828\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"6802\",\"type\":\"SaveTool\"},{\"attributes\":{\"factors\":[\"setosa\",\"versicolor\",\"virginica\"],\"palette\":[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\"]},\"id\":\"6814\",\"type\":\"CategoricalColorMapper\"},{\"attributes\":{},\"id\":\"6803\",\"type\":\"ResetTool\"}],\"root_ids\":[\"6780\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"06ff9ff8-2f81-42a3-b772-653e71e54ce9\",\"root_ids\":[\"6780\"],\"roots\":{\"6780\":\"2d8cb5eb-7d4c-4885-b3d6-83a893ad7595\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "6780"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.sampledata.iris import flowers\n",
    "from bokeh.transform import factor_cmap,factor_mark\n",
    "# 鸢尾花品种及分类标记\n",
    "SPECIES = ['setosa','versicolor','virginica']\n",
    "MARKERS = ['hex','circle_x','triangle']\n",
    "# 画布\n",
    "p = figure(title = \"Iris Morphology\",background_fill_color=\"#fafafa\")\n",
    "# 绘图\n",
    "p.scatter(\"petal_length\",\"sepal_width\",source=flowers,legend= \"species\",fill_alpha=0.4,size=12,\n",
    "         marker=factor_mark('species',MARKERS,SPECIES),\n",
    "         color=factor_cmap('species','Category10_3',SPECIES))\n",
    "\n",
    "# 其他\n",
    "p.xaxis.axis_label = 'Petal Length'\n",
    "p.yaxis.axis_label = 'Petal Length'\n",
    "# 显示\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 散点图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基本散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"7232\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id != null && id in Bokeh.index) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var id = msg.content.text.trim();\n",
       "            if (id in Bokeh.index) {\n",
       "              Bokeh.index[id].model.document.clear();\n",
       "              delete Bokeh.index[id];\n",
       "            }\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "        toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[toinsert.length - 1]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"7232\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = css_urls.length + js_urls.length;\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }\n",
       "\n",
       "    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\": \"T2yuo9Oe71Cz/I4X9Ac5+gpEa5a8PpJCDlqKYO0CfAuEszu1JrXLl8YugMqYe3sM\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\": \"98GDGJ0kOMCUMUePhksaQ/GYgB3+NH9h996V88sh3aOiUNX3N+fLXAtry6xctSZ6\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\": \"89bArO+nlbP3sgakeHjCo1JYxYR5wufVgA3IbUvDY+K7w4zyxJqssu7wVnfeKCq8\"};\n",
       "\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      if (url in hashes) {\n",
       "        element.crossOrigin = \"anonymous\";\n",
       "        element.integrity = \"sha384-\" + hashes[url];\n",
       "      }\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  \n",
       "  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\"];\n",
       "  var css_urls = [];\n",
       "  \n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "    \n",
       "    \n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if (root.Bokeh !== undefined || force === true) {\n",
       "      \n",
       "    for (var i = 0; i < inline_js.length; i++) {\n",
       "      inline_js[i].call(root, root.Bokeh);\n",
       "    }\n",
       "    if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"7232\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(css_urls, js_urls, function() {\n",
       "      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"7232\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }\n\n    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\": \"T2yuo9Oe71Cz/I4X9Ac5+gpEa5a8PpJCDlqKYO0CfAuEszu1JrXLl8YugMqYe3sM\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\": \"98GDGJ0kOMCUMUePhksaQ/GYgB3+NH9h996V88sh3aOiUNX3N+fLXAtry6xctSZ6\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\": \"89bArO+nlbP3sgakeHjCo1JYxYR5wufVgA3IbUvDY+K7w4zyxJqssu7wVnfeKCq8\"};\n\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      if (url in hashes) {\n        element.crossOrigin = \"anonymous\";\n        element.integrity = \"sha384-\" + hashes[url];\n      }\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n  };\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  \n  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js\"];\n  var css_urls = [];\n  \n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    function(Bokeh) {\n    \n    \n    }\n  ];\n\n  function run_inline_js() {\n    \n    if (root.Bokeh !== undefined || force === true) {\n      \n    for (var i = 0; i < inline_js.length; i++) {\n      inline_js[i].call(root, root.Bokeh);\n    }\n    if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"7232\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(css_urls, js_urls, function() {\n      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"c784e1d9-6f7c-44d4-87ed-a8b7794b330f\" data-root-id=\"7233\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"26d5a2df-18e2-4672-888f-0fa440026862\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"7242\"}],\"center\":[{\"id\":\"7245\"},{\"id\":\"7249\"},{\"id\":\"7278\"}],\"left\":[{\"id\":\"7246\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"7267\"}],\"title\":{\"id\":\"7270\"},\"toolbar\":{\"id\":\"7257\"},\"x_range\":{\"id\":\"7234\"},\"x_scale\":{\"id\":\"7238\"},\"y_range\":{\"id\":\"7236\"},\"y_scale\":{\"id\":\"7240\"}},\"id\":\"7233\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"7254\",\"type\":\"ResetTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"7256\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"7274\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],\"y\":{\"__ndarray__\":\"NgLNEqL1hT9dimtx13Pqv+7jXfGix9U/Na+LrnFx/j+RkwJVjWbpP8VduWIHBPO/z3MThdf3wD+3gnslKAD9P3NAomHg1/0/XdZxb5DQzD9lLxsEc2TRv9ynONuqSfI/65UjokDM4T/easQgX9XZP/4BAt9gXvq/3rstQxvI67+rUkbwdCzKP/pIjxXirfg/oBUZQIaW9z+eECbEoMf2v+kTpG/PEPQ/kKgWq/CN5j+6lkRTmE8DQCQSOHkhJu4/jwREyV474r84m9g16KXyP+Ore5XuDPI/YknhZZF647/WV2fpfeatP85QI7iDEdY/fMPegN4E7D8WMnXC5Z7wP2LUgmNdnOQ/j316edGe9r/S/bMigJQBwPgkpDLBx/S/P7j2eemppj9yFY+0wzLiP+P/DyRE++y/yyD45b8q4j9jZS6zrdTsP+kNI14lJeo/IW8+uwTr3D+6hZpxh7zCP8niu53l+PE/HWFA3Uxf2D/DSUlZLEQBQKL9sjDLUP6/oXIxeSmdy7+WLbrKk1Tuv7PDe/C8bPC/dkBgPxfG7D9AXfhT+xvsv7p6hQqGHsE/kJkm8josAMD5nDfib5WoPy/+APoVZ+o/o0j8L0NI0z/BA3AxUejzP7tXmvTQfcg/ZIA4j4qhyb9sqibj/zrYv9j33JCZOQfA+7As/Jgbyj9fcODs/wgDwP8barQK8wRAQFOZ3Ois4L+q4cIB+A3lv6G+RcnIve2/AwAMm2L26D9N7qyMh/nxPxj5rx0DseU/tzmtlB1V2z9d/NoSxezhv5Hox/oTbgJABxGhj4+m/j/EsE13qjTYv1nTcO06sfu/UMp3RfAdgr9XGpjxc8znPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[80]}},\"selected\":{\"id\":\"7277\"},\"selection_policy\":{\"id\":\"7276\"}},\"id\":\"7264\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"7255\",\"type\":\"HelpTool\"},{\"attributes\":{\"source\":{\"id\":\"7264\"}},\"id\":\"7268\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7250\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"7236\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.8},\"line_dash\":[6],\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":25},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7265\",\"type\":\"Circle\"},{\"attributes\":{\"items\":[{\"id\":\"7279\"}],\"location\":\"bottom_right\"},\"id\":\"7278\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"7234\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_dash\":[6],\"line_width\":{\"value\":2},\"size\":{\"units\":\"screen\",\"value\":25},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7266\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"7276\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"7264\"},\"glyph\":{\"id\":\"7265\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7266\"},\"selection_glyph\":null,\"view\":{\"id\":\"7268\"}},\"id\":\"7267\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7240\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"7277\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"7272\"},\"ticker\":{\"id\":\"7243\"}},\"id\":\"7242\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"7238\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"7253\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"7251\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"7272\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"text\":\"\"},\"id\":\"7270\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"7274\"},\"ticker\":{\"id\":\"7247\"}},\"id\":\"7246\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"7242\"},\"ticker\":null},\"id\":\"7245\",\"type\":\"Grid\"},{\"attributes\":{\"axis\":{\"id\":\"7246\"},\"dimension\":1,\"ticker\":null},\"id\":\"7249\",\"type\":\"Grid\"},{\"attributes\":{\"label\":{\"value\":\"scatter-circle\"},\"renderers\":[{\"id\":\"7267\"}]},\"id\":\"7279\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"7243\",\"type\":\"BasicTicker\"},{\"attributes\":{\"overlay\":{\"id\":\"7256\"}},\"id\":\"7252\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"7250\"},{\"id\":\"7251\"},{\"id\":\"7252\"},{\"id\":\"7253\"},{\"id\":\"7254\"},{\"id\":\"7255\"}]},\"id\":\"7257\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"7247\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"7233\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"26d5a2df-18e2-4672-888f-0fa440026862\",\"root_ids\":[\"7233\"],\"roots\":{\"7233\":\"c784e1d9-6f7c-44d4-87ed-a8b7794b330f\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "7233"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 导入pandas库\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "# 不发出警告\n",
    "\n",
    "from bokeh.io import output_notebook\n",
    "output_notebook()\n",
    "# 导入notebook绘图模块\n",
    "\n",
    "from bokeh.plotting import figure,show\n",
    "# 1、基本散点图绘制\n",
    "\n",
    "s = pd.Series(np.random.randn(80))\n",
    "# 创建数据\n",
    "\n",
    "p = figure(plot_width=600, plot_height=400)\n",
    "p.circle(s.index, s.values,                  # x，y值，也可以写成：x=s.index, y = s.values\n",
    "         size=25, color=\"navy\", alpha=0.5,   # 点的大小、颜色、透明度（注意，这里的color是线+填充的颜色，同时线和填充可以分别上色，参数如下）\n",
    "         fill_color = 'red',fill_alpha = 0.6, # 填充的颜色、透明度\n",
    "         line_color = 'black',line_alpha = 0.8,line_dash = 'dashed',line_width = 2,   # 点边线的颜色、透明度、虚线、宽度\n",
    "         # 同时还有line_cap、line_dash_offset、line_join参数    \n",
    "         legend = 'scatter-circle',    # 设置图例\n",
    "         #radius = 2   # 设置点的半径，和size只能同时选一个\n",
    "        )\n",
    "# 创建散点图，基本参数\n",
    "# bokeh对line和fill是同样的设置方法\n",
    "\n",
    "p.legend.location = \"bottom_right\"\n",
    "# 设置图例位置\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 不同的散点符号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n",
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"66a30a8d-1392-4690-b72c-7bf8854d9b0c\" data-root-id=\"7695\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"1b1830f7-ea94-4ecd-858c-0a678723753f\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"7704\"}],\"center\":[{\"id\":\"7707\"},{\"id\":\"7711\"},{\"id\":\"7740\"}],\"left\":[{\"id\":\"7708\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"7729\"},{\"id\":\"7745\"},{\"id\":\"7762\"},{\"id\":\"7781\"},{\"id\":\"7802\"},{\"id\":\"7825\"},{\"id\":\"7850\"},{\"id\":\"7877\"},{\"id\":\"7906\"},{\"id\":\"7937\"},{\"id\":\"7970\"},{\"id\":\"8005\"}],\"title\":{\"id\":\"7732\"},\"toolbar\":{\"id\":\"7719\"},\"x_range\":{\"id\":\"7696\"},\"x_scale\":{\"id\":\"7700\"},\"y_range\":{\"id\":\"7698\"},\"y_scale\":{\"id\":\"7702\"}},\"id\":\"7695\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"label\":{\"value\":\"square_cross\"},\"renderers\":[{\"id\":\"7906\"}]},\"id\":\"7933\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"triangle\"},\"renderers\":[{\"id\":\"7970\"}]},\"id\":\"8001\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"8036\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"8002\"}},\"id\":\"8006\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7931\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"7734\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"7775\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"7736\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":1}},\"id\":\"7848\",\"type\":\"InvertedTriangle\"},{\"attributes\":{},\"id\":\"7776\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"7932\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"diamond\"},\"renderers\":[{\"id\":\"7802\"}]},\"id\":\"7821\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"8037\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":4}},\"id\":\"7780\",\"type\":\"Cross\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":5}},\"id\":\"7800\",\"type\":\"Diamond\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":4}},\"id\":\"7936\",\"type\":\"SquareX\"},{\"attributes\":{},\"id\":\"7796\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"7778\"}},\"id\":\"7782\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":5}},\"id\":\"7968\",\"type\":\"Triangle\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7820\"},\"selection_policy\":{\"id\":\"7819\"}},\"id\":\"7799\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"7964\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":6}},\"id\":\"7823\",\"type\":\"DiamondCross\"},{\"attributes\":{\"source\":{\"id\":\"7934\"}},\"id\":\"7938\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7738\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"8000\"},\"selection_policy\":{\"id\":\"7999\"}},\"id\":\"7967\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"7778\"},\"glyph\":{\"id\":\"7779\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7780\"},\"selection_glyph\":null,\"view\":{\"id\":\"7782\"}},\"id\":\"7781\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7739\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"square_x\"},\"renderers\":[{\"id\":\"7937\"}]},\"id\":\"7966\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"7934\"},\"glyph\":{\"id\":\"7935\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7936\"},\"selection_glyph\":null,\"view\":{\"id\":\"7938\"}},\"id\":\"7937\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7797\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"circle_cross\"},\"renderers\":[{\"id\":\"7729\"}]},\"id\":\"7741\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"7965\",\"type\":\"Selection\"},{\"attributes\":{\"label\":{\"value\":\"x\"},\"renderers\":[{\"id\":\"8005\"}]},\"id\":\"8038\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":2}},\"id\":\"7744\",\"type\":\"Asterisk\"},{\"attributes\":{\"label\":{\"value\":\"asterisk\"},\"renderers\":[{\"id\":\"7745\"}]},\"id\":\"7758\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":3}},\"id\":\"7760\",\"type\":\"CircleX\"},{\"attributes\":{\"source\":{\"id\":\"7799\"}},\"id\":\"7803\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"7742\"}},\"id\":\"7746\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"7819\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":5}},\"id\":\"7801\",\"type\":\"Diamond\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":5}},\"id\":\"7969\",\"type\":\"Triangle\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7776\"},\"selection_policy\":{\"id\":\"7775\"}},\"id\":\"7759\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7845\"},\"selection_policy\":{\"id\":\"7844\"}},\"id\":\"7822\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":6}},\"id\":\"8003\",\"type\":\"X\"},{\"attributes\":{\"label\":{\"value\":\"circle_x\"},\"renderers\":[{\"id\":\"7762\"}]},\"id\":\"7777\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"7999\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data_source\":{\"id\":\"7742\"},\"glyph\":{\"id\":\"7743\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7744\"},\"selection_glyph\":null,\"view\":{\"id\":\"7746\"}},\"id\":\"7745\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"7799\"},\"glyph\":{\"id\":\"7800\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7801\"},\"selection_glyph\":null,\"view\":{\"id\":\"7803\"}},\"id\":\"7802\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"7967\"}},\"id\":\"7971\",\"type\":\"CDSView\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"8037\"},\"selection_policy\":{\"id\":\"8036\"}},\"id\":\"8002\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"8002\"},\"glyph\":{\"id\":\"8003\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"8004\"},\"selection_glyph\":null,\"view\":{\"id\":\"8006\"}},\"id\":\"8005\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"7967\"},\"glyph\":{\"id\":\"7968\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7969\"},\"selection_glyph\":null,\"view\":{\"id\":\"7971\"}},\"id\":\"7970\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7756\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"7820\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"7757\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"8000\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"7759\"}},\"id\":\"7763\",\"type\":\"CDSView\"},{\"attributes\":{\"source\":{\"id\":\"7822\"}},\"id\":\"7826\",\"type\":\"CDSView\"},{\"attributes\":{\"label\":{\"value\":\"diamond_cross\"},\"renderers\":[{\"id\":\"7825\"}]},\"id\":\"7846\",\"type\":\"LegendItem\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":3}},\"id\":\"7761\",\"type\":\"CircleX\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":6}},\"id\":\"7824\",\"type\":\"DiamondCross\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7797\"},\"selection_policy\":{\"id\":\"7796\"}},\"id\":\"7778\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7872\"},\"selection_policy\":{\"id\":\"7871\"}},\"id\":\"7847\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"7759\"},\"glyph\":{\"id\":\"7760\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7761\"},\"selection_glyph\":null,\"view\":{\"id\":\"7763\"}},\"id\":\"7762\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":6}},\"id\":\"8004\",\"type\":\"X\"},{\"attributes\":{\"data_source\":{\"id\":\"7822\"},\"glyph\":{\"id\":\"7823\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7824\"},\"selection_glyph\":null,\"view\":{\"id\":\"7826\"}},\"id\":\"7825\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7844\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":1}},\"id\":\"7727\",\"type\":\"CircleCross\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7739\"},\"selection_policy\":{\"id\":\"7738\"}},\"id\":\"7726\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":2}},\"id\":\"7743\",\"type\":\"Asterisk\"},{\"attributes\":{},\"id\":\"7845\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7757\"},\"selection_policy\":{\"id\":\"7756\"}},\"id\":\"7742\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":4}},\"id\":\"7779\",\"type\":\"Cross\"},{\"attributes\":{\"end\":3},\"id\":\"7696\",\"type\":\"Range1d\"},{\"attributes\":{\"end\":7},\"id\":\"7698\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"7705\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"7702\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"7734\"},\"ticker\":{\"id\":\"7705\"}},\"id\":\"7704\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":2}},\"id\":\"7875\",\"type\":\"Square\"},{\"attributes\":{},\"id\":\"7700\",\"type\":\"LinearScale\"},{\"attributes\":{\"label\":{\"value\":\"cross\"},\"renderers\":[{\"id\":\"7781\"}]},\"id\":\"7798\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"inverted_triangle\"},\"renderers\":[{\"id\":\"7850\"}]},\"id\":\"7873\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"7717\",\"type\":\"HelpTool\"},{\"attributes\":{\"formatter\":{\"id\":\"7736\"},\"ticker\":{\"id\":\"7709\"}},\"id\":\"7708\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"7704\"},\"ticker\":null},\"id\":\"7707\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"7847\"}},\"id\":\"7851\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":1}},\"id\":\"7849\",\"type\":\"InvertedTriangle\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7901\"},\"selection_policy\":{\"id\":\"7900\"}},\"id\":\"7874\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"7847\"},\"glyph\":{\"id\":\"7848\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7849\"},\"selection_glyph\":null,\"view\":{\"id\":\"7851\"}},\"id\":\"7850\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"7708\"},\"dimension\":1,\"ticker\":null},\"id\":\"7711\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"7709\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"7871\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":1},\"y\":{\"value\":1}},\"id\":\"7728\",\"type\":\"CircleCross\"},{\"attributes\":{},\"id\":\"7713\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"7712\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"7718\"}},\"id\":\"7714\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"7715\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"7716\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"7872\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"7732\",\"type\":\"Title\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":3}},\"id\":\"7904\",\"type\":\"SquareCross\"},{\"attributes\":{},\"id\":\"7900\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"source\":{\"id\":\"7874\"}},\"id\":\"7878\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":2}},\"id\":\"7876\",\"type\":\"Square\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"7718\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7932\"},\"selection_policy\":{\"id\":\"7931\"}},\"id\":\"7903\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"square\"},\"renderers\":[{\"id\":\"7877\"}]},\"id\":\"7902\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"7874\"},\"glyph\":{\"id\":\"7875\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7876\"},\"selection_glyph\":null,\"view\":{\"id\":\"7878\"}},\"id\":\"7877\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"7901\",\"type\":\"Selection\"},{\"attributes\":{\"source\":{\"id\":\"7726\"}},\"id\":\"7730\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":3}},\"id\":\"7905\",\"type\":\"SquareCross\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"7712\"},{\"id\":\"7713\"},{\"id\":\"7714\"},{\"id\":\"7715\"},{\"id\":\"7716\"},{\"id\":\"7717\"}]},\"id\":\"7719\",\"type\":\"Toolbar\"},{\"attributes\":{\"source\":{\"id\":\"7903\"}},\"id\":\"7907\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":30},\"x\":{\"value\":2},\"y\":{\"value\":4}},\"id\":\"7935\",\"type\":\"SquareX\"},{\"attributes\":{\"data_source\":{\"id\":\"7903\"},\"glyph\":{\"id\":\"7904\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7905\"},\"selection_glyph\":null,\"view\":{\"id\":\"7907\"}},\"id\":\"7906\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"7726\"},\"glyph\":{\"id\":\"7727\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"7728\"},\"selection_glyph\":null,\"view\":{\"id\":\"7730\"}},\"id\":\"7729\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{},\"selected\":{\"id\":\"7965\"},\"selection_policy\":{\"id\":\"7964\"}},\"id\":\"7934\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"items\":[{\"id\":\"7741\"},{\"id\":\"7758\"},{\"id\":\"7777\"},{\"id\":\"7798\"},{\"id\":\"7821\"},{\"id\":\"7846\"},{\"id\":\"7873\"},{\"id\":\"7902\"},{\"id\":\"7933\"},{\"id\":\"7966\"},{\"id\":\"8001\"},{\"id\":\"8038\"}],\"location\":\"bottom_right\"},\"id\":\"7740\",\"type\":\"Legend\"}],\"root_ids\":[\"7695\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"1b1830f7-ea94-4ecd-858c-0a678723753f\",\"root_ids\":[\"7695\"],\"roots\":{\"7695\":\"66a30a8d-1392-4690-b72c-7bf8854d9b0c\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "7695"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 3、不同符号的散点图\n",
    "# asterisk(), circle(), circle_cross(), circle_x(), cross(), diamond(), diamond_cross(), inverted_triangle()\n",
    "# square(), square_cross(), square_x(), triangle(), x()\n",
    "\n",
    "p = figure(plot_width=600, plot_height=400,x_range = [0,3], y_range = [0,7])\n",
    "\n",
    "p.circle_cross(1, 1, size = 30, alpha = 0.5, legend = 'circle_cross')\n",
    "p.asterisk(1, 2, size = 30, alpha = 0.5, legend = 'asterisk')\n",
    "p.circle_x(1, 3, size = 30, alpha = 0.5, legend = 'circle_x')\n",
    "p.cross(1, 4, size = 30, alpha = 0.5, legend = 'cross')\n",
    "p.diamond(1, 5, size = 30, alpha = 0.5, legend = 'diamond')\n",
    "p.diamond_cross(1, 6, size = 30, alpha = 0.5, legend = 'diamond_cross')\n",
    "p.inverted_triangle(2, 1, size = 30, alpha = 0.5, legend = 'inverted_triangle')\n",
    "p.square(2, 2, size = 30, alpha = 0.5, legend = 'square')\n",
    "p.square_cross(2, 3, size = 30, alpha = 0.5, legend = 'square_cross')\n",
    "p.square_x(2, 4, size = 30, alpha = 0.5, legend = 'square_x')\n",
    "p.triangle(2, 5, size = 30, alpha = 0.5, legend = 'triangle')\n",
    "p.x(2, 6, size = 30, alpha = 0.5, legend = 'x')\n",
    "\n",
    "p.legend.location = \"bottom_right\"\n",
    "# 设置图例位置\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 散点大小、颜色"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "            A           B  size color1\n",
      "0  162.434536  -61.175641    24   blue\n",
      "1  -52.817175 -107.296862    18   blue\n",
      "2   86.540763 -230.153870    17    red\n",
      "3  174.481176  -76.120690    26  green\n",
      "4   31.903910  -24.937038    15    red\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"a9cdf3e4-2c1c-472d-a25b-4e26ff6bfd52\" data-root-id=\"8595\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"e3325fca-a463-42da-ae93-42e93557d030\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"8604\"}],\"center\":[{\"id\":\"8607\"},{\"id\":\"8611\"}],\"left\":[{\"id\":\"8608\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"8629\"}],\"title\":{\"id\":\"9033\"},\"toolbar\":{\"id\":\"8619\"},\"x_range\":{\"id\":\"8596\"},\"x_scale\":{\"id\":\"8600\"},\"y_range\":{\"id\":\"8598\"},\"y_scale\":{\"id\":\"8602\"}},\"id\":\"8595\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"8612\"},{\"id\":\"8613\"},{\"id\":\"8614\"},{\"id\":\"8615\"},{\"id\":\"8616\"},{\"id\":\"8617\"}]},\"id\":\"8619\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"8596\",\"type\":\"DataRange1d\"},{\"attributes\":{\"axis\":{\"id\":\"8608\"},\"dimension\":1,\"ticker\":null},\"id\":\"8611\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"9037\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"8600\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"8609\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"8605\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"8615\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"8613\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"9033\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"9037\"},\"ticker\":{\"id\":\"8609\"}},\"id\":\"8608\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"9035\"},\"ticker\":{\"id\":\"8605\"}},\"id\":\"8604\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"8612\",\"type\":\"PanTool\"},{\"attributes\":{\"axis\":{\"id\":\"8604\"},\"ticker\":null},\"id\":\"8607\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"fill_color\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"white\"},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8628\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"9039\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"data\":{\"fill_color\":[\"blue\",\"blue\",\"red\",\"green\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"blue\",\"blue\",\"red\",\"red\",\"green\",\"green\",\"blue\",\"blue\",\"green\",\"green\",\"blue\",\"green\",\"green\",\"blue\",\"blue\",\"blue\",\"red\",\"blue\",\"red\",\"green\",\"red\",\"red\",\"red\",\"blue\",\"blue\",\"green\",\"blue\",\"green\",\"red\",\"red\",\"red\",\"red\",\"green\",\"green\",\"red\",\"red\",\"red\",\"red\",\"blue\",\"blue\",\"red\",\"blue\",\"blue\",\"red\",\"green\",\"red\",\"red\",\"green\",\"red\",\"blue\",\"red\",\"green\",\"red\",\"red\",\"blue\",\"red\",\"green\",\"blue\",\"red\",\"green\",\"red\",\"red\",\"blue\",\"red\",\"green\",\"blue\",\"red\",\"green\",\"red\",\"green\",\"red\",\"green\",\"green\",\"blue\",\"red\",\"green\",\"green\",\"blue\",\"green\",\"green\",\"red\",\"green\",\"red\",\"green\",\"green\",\"blue\",\"green\",\"blue\",\"red\",\"blue\",\"green\"],\"size\":[24,18,17,26,15,12,12,24,21,20,18,26,15,19,23,18,20,21,16,10,24,14,21,13,10,24,27,16,10,11,16,14,28,15,16,28,28,24,17,26,17,21,24,18,18,18,26,12,10,17,22,27,11,20,19,21,15,27,15,20,24,27,20,18,26,29,22,23,26,14,28,14,13,22,12,22,10,10,25,14,20,22,28,15,26,10,21,22,21,13,22,25,29,23,11,14,17,13,12,12],\"x\":{\"__ndarray__\":\"HknPuOdNZEC4IKQymWhKwKp1IdybolVAtFIYzGXPZUBoELOeZuc/QJxgcNK+RmJA6kmxsfAeQMAd37TaH1hcQMKzQYApPjHAGQq6CrDiEECF/7519oNbwAkUkzwuilZALXEkY3qFVkC4IZDD+pMowL8yklHvyTrAqazC+aBKUcA/8XrA5y1RwFLEJ6n5x1DAnMVzRsnuW8DIdIjxXb9kQLtS2Hn9LjPADuACJtCtUsAuforOtlIUQPSsZrhvFzNABQsGbCMIKEB2A3g1XAQ+QKS/zdAdkFzAMcRyP7HjNMCP799sfvlUQGfqQxgJjzxAUMImliXcUsDQ7H9vgKVJQOUNOEMIbUhA6Gihlm1KXEDeBX9f11FrQAVHhwcqDWLAfJw28PIAMEDtvLMwQZA/QGZI/p3Snj7AHi6R22wCN0AUMSW3mTs2wFMYY7v4pzJA/Aq7C3nUM0ClzAAXPcRQwDUTXcM/XShAbCrvDRP5XUDS5nW5pcNCwOxMpUy6LEVAsltfuVMxQcASe/TDAgBPwPspj+E+W0bAqQptabEsREDwhGyRb19bwBKCgbCPg1JAvI3XmTGfOsAeY3C1+SlhwFx/4ZptJ1VAL1UZEP2GQUC5zb8d1/QOwKmv7sUSCVxAn9XKdI2xA8A980m3CdhfQLJ/TL6KOWfA1Q06f3tYZECHcoK+UPtdwEnPrEqPFzLAU7XdP1/AXsBGMuXE9tFTQHsUlIpgB0pAIptXHekLVECcbDyoL6gywOAuYxTfuFVAwguP+Sd5SkBwKfEs4iAfQMQP0VfcPzdAVBx0Sf0CP8D9qEk6evhZQAI3OQJ3EUZAWOkUjPhJK8AZ+JHF5Nr7P+iCpR7P2knAIUUfL0LhOEDFtWZ3tMJIQAOoXJKLqFhAbAPNNz1ia0BTSVJNRCxQwJueRGukmm9A3CtsdLR3EUDzYKiqqaRgQHbP92xyAFFAF4C8Q2DQX8DpbSX/wyhJQHeQwEPjFibAn/23j1cjTEDyGkGmBhE8QCVEjLYqAl1Ak5PzaejOZ0CTJZkv63lQQMr/UtGvHU5AsTGBOBdGVEA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[100]},\"y\":{\"__ndarray__\":\"HkSPanuWTsCT32DK/9JawKu9H4DsxGzAeNnsYrkHU8Dzq1ax4e84wB2i60RzwGnAjFwzT+UzQ8BxvjTaTX9bwMpDXztL8lXADQlu5AgkTUBk7IFTO55cQOhuIHPtH0lARPJ2udsXUcBieh6k7GRXwCjEHMuMhEpAO/Tw9HHWQ8DjykvsUCFVwD/SlXJrQ/S/y1ebtwpxN0CLrxYnFY1SQBMrdUvTMFbAezwlz9onZUDEfK1Vi9lPwHZo/wHRQGpAriRfJjPcTkC+iAdMzJxBwB3ymDuWd0HAfSJ038ZUTUBl6GamDUdXQE0nlkjnIFZAqit/L1tSX0D3zkE0Lc89wLBAIx2LOh7AYI2e72n/YkBE0UvMyXRhwNsrXb0pOUnADiUNKXvnVUCzsWo8C0dpwKHiiacJs1RAoqkpHt8MU0DKPp4UaBM0wACF0TypgERATNtQHz7NJ0AzHdgD0eBCQND/SW+yPFxAX879GAGEMkD91JTMv+9PwKr82nyf7x5ACJiccVFwEUBxg0OvZ3NRQLL9bWzZnF5AFo/dGs6tTUCNY5q2MPAwQNOD5RCv11fA0nixi3UXCkB643iXFIQ/QO+Z3urmfFXA4lkLkk5nYMAAZYW2eDJkwC7GX0jtcURAECb+ywhhU8Ah68PAuZZoQAgpwiVz515Ad6QyuozmQEBeKOD3aJVVQGiX9xwvMk7AlfpNROGGS0A8Sbl+MS1PwMlDye7Im1zANemtyX2gEkD5IRuAY1kkwNHyRW6iwlJAKK63TE2KK0Bax0hxROtOQDkLmjlUEFFA9dKqGHtvbsCZpg+6VVZrQCwtd6zyByTAKO7MDJPPJ8A8rzR86wxcwA3QIcH47FjAkw/IdAOqPcDHMLCgZngxwCNNmsZ3WjVAyV433lq0Z8AFGY8fhIlWQPGcFeEM3TjApX4NBaWhNsA7UGfQFLs8wIvUL8Lr+j/AQJRAV9JaP0DEtZmkUipgQG7IpwI83k7AAYWRm94SOECJrT6pvT4dwGUyp7uBeUJAOfp/S8PGW0CrChd9zVdkwCO/k7mcA0VA1VWP7W0cWkA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[100]}},\"selected\":{\"id\":\"9040\"},\"selection_policy\":{\"id\":\"9039\"}},\"id\":\"8626\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"8598\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"8618\"}},\"id\":\"8614\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"8602\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9040\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"fill_color\"},\"line_color\":{\"value\":\"white\"},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8627\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"8626\"},\"glyph\":{\"id\":\"8627\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"8628\"},\"selection_glyph\":null,\"view\":{\"id\":\"8630\"}},\"id\":\"8629\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"9035\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"8626\"}},\"id\":\"8630\",\"type\":\"CDSView\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"8618\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"8617\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"8616\",\"type\":\"ResetTool\"}],\"root_ids\":[\"8595\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"e3325fca-a463-42da-ae93-42e93557d030\",\"root_ids\":[\"8595\"],\"roots\":{\"8595\":\"a9cdf3e4-2c1c-472d-a25b-4e26ff6bfd52\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "8595"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 2、散点图不同 颜色上色/散点大小 的方法\n",
    "# ① 数据中有一列专门用于设置颜色 / 点大小\n",
    "\n",
    "from bokeh.palettes import brewer\n",
    "\n",
    "rng = np.random.RandomState(1)\n",
    "df = pd.DataFrame(rng.randn(100,2)*100,columns = ['A','B'])\n",
    "# 创建数据，有2列随机值\n",
    "\n",
    "df['size'] = rng.randint(10,30,100)   # 设置点大小字段\n",
    "\n",
    "# colormap1 = {1: 'red', 2: 'green', 3: 'blue'}    \n",
    "# df['color1'] = [colormap1[x] for x in rng.randint(1,4,100)]           # 调色盘1；\n",
    "df['color1'] = np.random.choice(['red', 'green', 'blue'], 100) #跟上面两行是一样的；  这两种都是在本身的数据中增加size和color1标签，再去绘制图标；\n",
    "\n",
    "print(df.head())\n",
    "\n",
    "p = figure(plot_width=600, plot_height=400)\n",
    "p.circle(df['A'], df['B'],       # 设置散点图x，y值\n",
    "         line_color = 'white',   # 设置点边线为白色\n",
    "         fill_color = df['color1'],fill_alpha = 0.5,   # 设置内部填充颜色，这里用到了颜色字段\n",
    "         size = df['size']       # 设置点大小，这里用到了点大小字段,按照size的随机数去设置点的大小\n",
    "        )\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "            A           B  type\n",
      "0  162.434536  -61.175641     6\n",
      "1  -52.817175 -107.296862     0\n",
      "2   86.540763 -230.153870     1\n",
      "3  174.481176  -76.120690     0\n",
      "4   31.903910  -24.937038     5\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"967abf6c-499c-40fc-9f79-3e5adc0cc8b7\" data-root-id=\"9086\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"b472311c-7b5f-4a67-b4a4-472ce3274653\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"9095\"}],\"center\":[{\"id\":\"9098\"},{\"id\":\"9102\"},{\"id\":\"9193\"}],\"left\":[{\"id\":\"9099\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"9182\"}],\"title\":{\"id\":\"9185\"},\"toolbar\":{\"id\":\"9110\"},\"x_range\":{\"id\":\"9087\"},\"x_scale\":{\"id\":\"9091\"},\"y_range\":{\"id\":\"9089\"},\"y_scale\":{\"id\":\"9093\"}},\"id\":\"9086\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"9192\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"9093\",\"type\":\"LinearScale\"},{\"attributes\":{\"text\":\"\"},\"id\":\"9185\",\"type\":\"Title\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9109\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"9089\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"9189\"},\"ticker\":{\"id\":\"9100\"}},\"id\":\"9099\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"9087\",\"type\":\"DataRange1d\"},{\"attributes\":{\"label\":{\"value\":\"type6\"},\"renderers\":[{\"id\":\"9182\"}]},\"id\":\"9194\",\"type\":\"LegendItem\"},{\"attributes\":{\"formatter\":{\"id\":\"9187\"},\"ticker\":{\"id\":\"9096\"}},\"id\":\"9095\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"9187\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"9106\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"9091\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9189\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"9099\"},\"dimension\":1,\"ticker\":null},\"id\":\"9102\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"9103\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"9109\"}},\"id\":\"9105\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"9191\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"salmon\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"salmon\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9181\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"9108\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"9104\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis\":{\"id\":\"9095\"},\"ticker\":null},\"id\":\"9098\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"9103\"},{\"id\":\"9104\"},{\"id\":\"9105\"},{\"id\":\"9106\"},{\"id\":\"9107\"},{\"id\":\"9108\"}]},\"id\":\"9110\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"9100\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"9096\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"HknPuOdNZEDCs0GAKT4xwAULBmwjCChAdgN4NVwEPkAxxHI/seM0wOhooZZtSlxAfJw28PIAMEAeLpHbbAI3QFMYY7v4pzJAsltfuVMxQcD7KY/hPltGwBKCgbCPg1JAPfNJtwnYX0DVDTp/e1hkQEYy5cT20VNAbAPNNz1ia0DzYKiqqaRgQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[17]},\"y\":{\"__ndarray__\":\"HkSPanuWTsDKQ187S/JVwK4kXyYz3E5AvogHTMycQcB9InTfxlRNQGCNnu9p/2JADiUNKXvnVUCiqSke3wxTQACF0TypgERACJiccVFwEUCy/W1s2ZxeQNOD5RCv11fAIevDwLmWaEB3pDK6jOZAQDxJuX4xLU/AyV433lq0Z8A7UGfQFLs8wA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[17]}},\"selected\":{\"id\":\"9192\"},\"selection_policy\":{\"id\":\"9191\"}},\"id\":\"9179\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"salmon\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"salmon\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9180\",\"type\":\"Circle\"},{\"attributes\":{\"items\":[{\"id\":\"9194\"}]},\"id\":\"9193\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"9107\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"9179\"},\"glyph\":{\"id\":\"9180\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"9181\"},\"selection_glyph\":null,\"view\":{\"id\":\"9183\"}},\"id\":\"9182\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"9179\"}},\"id\":\"9183\",\"type\":\"CDSView\"}],\"root_ids\":[\"9086\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"b472311c-7b5f-4a67-b4a4-472ce3274653\",\"root_ids\":[\"9086\"],\"roots\":{\"9086\":\"967abf6c-499c-40fc-9f79-3e5adc0cc8b7\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "9086"
      }
     },
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"bc5c0184-bf03-410a-9ce9-bb5f9b144703\" data-root-id=\"9117\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"a3d57e7b-1bc1-49f2-b684-0649011cd491\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"9126\"}],\"center\":[{\"id\":\"9129\"},{\"id\":\"9133\"},{\"id\":\"9673\"}],\"left\":[{\"id\":\"9130\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"9662\"}],\"title\":{\"id\":\"9665\"},\"toolbar\":{\"id\":\"9141\"},\"x_range\":{\"id\":\"9118\"},\"x_scale\":{\"id\":\"9122\"},\"y_range\":{\"id\":\"9120\"},\"y_scale\":{\"id\":\"9124\"}},\"id\":\"9117\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"9139\",\"type\":\"HelpTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"9665\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"9672\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"9135\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"9134\",\"type\":\"PanTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"9134\"},{\"id\":\"9135\"},{\"id\":\"9136\"},{\"id\":\"9137\"},{\"id\":\"9138\"},{\"id\":\"9139\"}]},\"id\":\"9141\",\"type\":\"Toolbar\"},{\"attributes\":{\"overlay\":{\"id\":\"9140\"}},\"id\":\"9136\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"9137\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"9138\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"9669\"},\"ticker\":{\"id\":\"9131\"}},\"id\":\"9130\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"uCCkMploSsC0UhjMZc9lQLghkMP6kyjAP/F6wOctUcAO4AIm0K1SwKS/zdAdkFzA5Q04QwhtSEBmSP6d0p4+wB5jcLX5KWHAsn9Mvoo5Z8CHcoK+UPtdwEnPrEqPFzLAU7XdP1/AXsCcbDyoL6gywNwrbHS0dxFAn/23j1cjTEDyGkGmBhE8QA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[17]},\"y\":{\"__ndarray__\":\"k99gyv/SWsB42exiuQdTwGJ6HqTsZFfA48pL7FAhVcB7PCXP2idlQB3ymDuWd0HAsEAjHYs6HsCh4omnCbNUQHrjeJcUhD9ACCnCJXPnXkBeKOD3aJVVQGiX9xwvMk7AlfpNROGGS0D5IRuAY1kkwKV+DQWloTbAAYWRm94SOECJrT6pvT4dwA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[17]}},\"selected\":{\"id\":\"9672\"},\"selection_policy\":{\"id\":\"9671\"}},\"id\":\"9659\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"red\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9660\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"9667\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"9669\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"label\":{\"value\":\"type0\"},\"renderers\":[{\"id\":\"9662\"}]},\"id\":\"9674\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"9127\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"9131\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"red\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9661\",\"type\":\"Circle\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9140\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"9659\"},\"glyph\":{\"id\":\"9660\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"9661\"},\"selection_glyph\":null,\"view\":{\"id\":\"9663\"}},\"id\":\"9662\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"9118\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"9122\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9671\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"9130\"},\"dimension\":1,\"ticker\":null},\"id\":\"9133\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"9659\"}},\"id\":\"9663\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"9126\"},\"ticker\":null},\"id\":\"9129\",\"type\":\"Grid\"},{\"attributes\":{\"items\":[{\"id\":\"9674\"}]},\"id\":\"9673\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"9120\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"9667\"},\"ticker\":{\"id\":\"9127\"}},\"id\":\"9126\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"9124\",\"type\":\"LinearScale\"}],\"root_ids\":[\"9117\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"a3d57e7b-1bc1-49f2-b684-0649011cd491\",\"root_ids\":[\"9117\"],\"roots\":{\"9117\":\"bc5c0184-bf03-410a-9ce9-bb5f9b144703\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "9117"
      }
     },
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "BokehDeprecationWarning: 'legend' keyword is deprecated, use explicit 'legend_label', 'legend_field', or 'legend_group' keywords instead\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"3cf9b8de-4550-42e3-a00b-188365b9fb7c\" data-root-id=\"9148\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"db352afa-65f0-4200-be5f-019c0bcf8b3c\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"9157\"}],\"center\":[{\"id\":\"9160\"},{\"id\":\"9164\"},{\"id\":\"10162\"}],\"left\":[{\"id\":\"9161\"}],\"plot_height\":400,\"renderers\":[{\"id\":\"10151\"}],\"title\":{\"id\":\"10154\"},\"toolbar\":{\"id\":\"9172\"},\"x_range\":{\"id\":\"9149\"},\"x_scale\":{\"id\":\"9153\"},\"y_range\":{\"id\":\"9151\"},\"y_scale\":{\"id\":\"9155\"}},\"id\":\"9148\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"items\":[{\"id\":\"10163\"}]},\"id\":\"10162\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"9149\",\"type\":\"DataRange1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9171\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"10160\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"label\":{\"value\":\"type1\"},\"renderers\":[{\"id\":\"10151\"}]},\"id\":\"10163\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"10161\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"10154\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"9153\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"10158\"},\"ticker\":{\"id\":\"9162\"}},\"id\":\"9161\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"9151\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"10156\"},\"ticker\":{\"id\":\"9158\"}},\"id\":\"9157\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"qnUh3JuiVUDIdIjxXb9kQAVHhwcqDWLAFDElt5k7NsCpCm1psSxEQMILj/kneUpAxA/RV9w/N0ACNzkCdxFGQOiCpR7P2knAxbVmd7TCSECbnkRrpJpvQOltJf/DKElAyv9S0a8dTkA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[13]},\"y\":{\"__ndarray__\":\"q70fgOzEbMCLrxYnFY1SQNsrXb0pOUnAyj6eFGgTNMAWj90azq1NQCiut0xNiitAOQuaOVQQUUAsLXes8gckwA3QIcH47FjAxzCwoGZ4McDxnBXhDN04wMS1maRSKmBAI7+TuZwDRUA=\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[13]}},\"selected\":{\"id\":\"10161\"},\"selection_policy\":{\"id\":\"10160\"}},\"id\":\"10148\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"9155\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"9170\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"9158\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"9157\"},\"ticker\":null},\"id\":\"9160\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"olive\"},\"line_alpha\":{\"value\":0.5},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"10149\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"9161\"},\"dimension\":1,\"ticker\":null},\"id\":\"9164\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"9162\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"10156\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"9165\"},{\"id\":\"9166\"},{\"id\":\"9167\"},{\"id\":\"9168\"},{\"id\":\"9169\"},{\"id\":\"9170\"}]},\"id\":\"9172\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"10158\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"9166\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"9165\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"9171\"}},\"id\":\"9167\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"9168\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"9169\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"olive\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"10150\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"10148\"},\"glyph\":{\"id\":\"10149\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"10150\"},\"selection_glyph\":null,\"view\":{\"id\":\"10152\"}},\"id\":\"10151\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"10148\"}},\"id\":\"10152\",\"type\":\"CDSView\"}],\"root_ids\":[\"9148\"]},\"title\":\"Bokeh Application\",\"version\":\"2.2.3\"}};\n",
       "  var render_items = [{\"docid\":\"db352afa-65f0-4200-be5f-019c0bcf8b3c\",\"root_ids\":[\"9148\"],\"roots\":{\"9148\":\"3cf9b8de-4550-42e3-a00b-188365b9fb7c\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "9148"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 2、散点图不同 颜色上色/散点大小 的方法\n",
    "# ② 遍历数据分开做图\n",
    "\n",
    "rng = np.random.RandomState(1)\n",
    "df = pd.DataFrame(rng.randn(100,2)*100,columns = ['A','B'])\n",
    "df['type'] = rng.randint(0,7,100)\n",
    "print(df.head())\n",
    "# 创建数据；type是做不同类别的一个分组\n",
    "\n",
    "colors = [\"red\", \"olive\", \"darkred\", \"goldenrod\", \"skyblue\", \"orange\", \"salmon\"]\n",
    "# 创建颜色列表\n",
    "\n",
    "p1 = figure(plot_width=600, plot_height=400)\n",
    "p2 = figure(plot_width=600, plot_height=400)\n",
    "p3 = figure(plot_width=600, plot_height=400)\n",
    "plst = [p1, p2, p3]\n",
    "# for t in df['type'].unique():\n",
    "for t,pi in zip(df['type'].unique()[:3], plst):\n",
    "    #p = figure(plot_width=600, plot_height=400,tools = \"pan,wheel_zoom,box_select,lasso_select,reset\")\n",
    "    pi.circle(df['A'][df['type'] == t], df['B'][df['type'] == t],       # 设置散点图x，y值\n",
    "             size = 20,alpha = 0.5,\n",
    "             color = colors[t],\n",
    "             legend = 'type%i' % t)\n",
    "    show(pi)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
